Forum Moderators: travelin cat

Message Too Old, No Replies

Mac fonts and Unicode webpages

Somewhat technical BBEdit font-mapping question

         

rjohara

7:13 pm on Dec 22, 2004 (gmt 0)

10+ Year Member



I markup all my webpages by hand with BBEdit, and up to now have always used the iso-8859-1 character set.

One of the nuisances of this method is having to encode lots of special characters with entity references, since I also try to create high quality typography on my pages. I always code in &-mdash; and &-ndash; and real apostrophes and proper quotation marks, and the like. If possible, I'd like to just be able to type these directly rather than having to encode them.

Here's where my understanding gets murky. I know in the old days the Mac had certain keyboard mapping issues, such that things like command-option-{ to produce a close-quote (high nines) might be peculiar to the Mac, and not cross-platform compatible. But I don't understand clearly how things work today.

Suppose I am working with BBEdit and am using a Mac font that is considered a Unicode font, like Lucida Grande:

[alanwood.net...]

If I specify that the page encoding is utf-8, can I then just type my em dashes, high nines, curved apostrophes, etc., directly from the keyboard and have them be rendered correctly by any web browser on any machine? I know they look OK when I view them on my Mac, but I don't know if that's just because it's a Mac and it understands what's going on.

Does this make sense? Can any encoding gurus clarify the matter?

Many thanks.

timster

8:04 pm on Dec 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebMasterWorld, rjohara!

The short answer is, you're in luck. Set your character encoding to Unicode (both in BBEdit and in the web page head) and any Unicode-savvy system will be able to read and display it correctly.

"Any Unicode-savvy system" is well short of "any web browser on any machine" however.

whoisgregg

9:34 pm on Dec 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It took me a lot of testing to accept that a → in a UTF-8 page can be either spelled out or just be the little right arrow copied and pasted from the browser display. But displaying in BBEdit, Safari, Mac IE 5.2.3, and every other mac browser isn't good enough -- you'll need to still test for their appearance in Windows browsers if those users are a concern of yours.

(Sometimes using a different font will prevent the dreaded square because the windows font is just lacking that glyph.)

rjohara

2:51 am on Dec 23, 2004 (gmt 0)

10+ Year Member



Thanks for the insights. I've been testing it a bit and it seems to work pretty well so far.

I'm familiar with the problem of certain characters not appearing because the fonts on the user's machine don't contain the glyph, but that's something that occurs with regular old Roman encoding as well. I often use &-middot; and sometimes that shows up as a square on Windows machines because of the chosen font. But if I declare utf-8 I can just type the middot on my Mac directly - it still may not show up on the user's machine, but it's much easier on my end to type and to read.

For the moment I'm less concerned with non-Roman alphabets (though I will work up to that), and more concerned with being able to use typographically correct punctuation, symbols, and accenting without having to encode it all with entity references.

Am I correct that the & symbol still needs to be encoded as &-amp;, even in Unicode? This is because regardless of encoding, an HTML parser will think the & represents the beginning of an entity reference of some kind?

rjohara

3:14 am on Dec 23, 2004 (gmt 0)

10+ Year Member



And the same seems to be true of < and > which must still be encoded as &-lt; and &-gt;, even under Unicode.

rjohara

11:53 pm on Dec 23, 2004 (gmt 0)

10+ Year Member



OK, I've taken the plunge and converted two small sections of my site to Unicode. All looks fine so far, and I'll leave them alone for a while to see if any problems turn up. I have limited access to Windows machines for testing.

The only character problem seems to be with the multiplication sign &-times;. It doesn't seem to map correctly from the OSX character palette for some reason, so I've left it as &-times;. I am going to upgrade to BBEdit 8.0 soon (have been using 7), and perhaps that has some additional utilities that will be of use.