On Monday 2006-03-27 23:15 -0500, Roger Roelofs wrote:
> On Mar 27, 2006, at 9:46 PM, Kim wrote:
> 
> > This seems like it must be so obvious, but I've looked at the <head>
> > about a million times and can't see what's happening.
> >
> > Basically, I have a test page that is using a stylesheet. Only Safari
> > recognizes the stylesheet and displays. For some some reason Firefox
> > and IE don't see it. I'm assuming something in the head or doctype of
> > my page is wrong, but I can't seem to figure it out. Help! :)
> >
> > http://www.theibisnet.com/test/index.html
> 
> Save as: options: encoding: utf-8 no bom (and change the meta 
> http-equiv="content-type..." to match.  The BOM is a 'byte order mark' 
> and is required for utf-16 so the reader knows how to read the two-byte 
> characters in the file.  it is fairly uncommon on web pages as you 
> discovered.

It's not really that it's uncommon on Web pages; I think UTF-16 is used
sometimes for East Asian languages, and generally with a BOM.

The issue is that the stylesheet is not in the same encoding, and the
browser's first guess at the encoding of the stylesheet is to use the
encoding of the document.  (This is actually contrary to the spec, but
all browsers have to do it because all the others do, or we break a lot
of Japanese (?) sites.)  If the style sheet began with: @charset
"UTF-8"; (or other appropriate single-byte encoding), it would probably
help.  (When I say begin, I mean it has to be the first characters in
the style sheet, with no comments or white space preceding.)

Also, "utf-16be-with-bom" is not a recognized encoding name; the
official list (http://www.iana.org/assignments/character-sets) contains
UTF-16BE.  Whether or not it has a BOM isn't part of the name.

That said, the advice "always use UTF-8" is sound advice, and probably
the best fix for this problem.  There's no reason for a Web page in
English to be using two bytes per character.  And it's also good to
always say what encoding you're using:
http://dbaron.org/log/2006-02#e20060212a
http://dbaron.org/log/2006-02#e20060212b

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Attachment: pgpYDEiEC03GA.pgp
Description: PGP signature

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to