Previous Message
Next Message

Firefox/IE not recognizing stylesheet

Sent by L. David Baron on 28 March 2006 05:05


--===============1825019876==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB"
Content-Disposition: inline


--tThc/1wpZn/ma/RB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Monday 2006-03-27 23:15 -0500, Roger Roelofs wrote:
> On Mar 27, 2006, at 9:46 PM, Kim wrote:
>=20
> > 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
>=20
> Save as: options: encoding: utf-8 no bom (and change the meta=20
> http-equiv=3D"content-type..." to match.  The BOM is a 'byte order mark'=
=20
> and is required for utf-16 so the reader knows how to read the two-byte=
=20
> characters in the file.  it is fairly uncommon on web pages as you=20
> 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

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

--tThc/1wpZn/ma/RB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEKMCMA17gpBIYPJsRAikyAKCYPie2R5Qrz/ja30VhM3ZKzhGTuACgu71W
R6TjIgH3HK6fzZ/Y9e/m144=
=8/KX
-----END PGP SIGNATURE-----

--tThc/1wpZn/ma/RB--

--===============1825019876==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
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/
--===============1825019876==--
Previous Message
Next Message

Message thread: