FW: New tests & results: CSS encoding detection

Hi Elika et al.

I thought you might be interested in these new tests on the i18n subsite: they don't cover things like utf-16, but can be extended.  As it stands, I don't think you have any similar tests in the CSS 2.1 suite.

Cheers,
RI

============
Richard Ishida
Internationalization Lead
W3C (World Wide Web Consortium)

http://www.w3.org/International/
http://rishida.net/



-----Original Message-----
From: www-international-request@w3.org [mailto:www-international-request@w3.org] On Behalf Of Richard Ishida
Sent: 08 August 2008 19:35
To: www-international@w3.org
Subject: New tests & results: CSS encoding detection


http://www.w3.org/International/tests/test-encoding-detection-6

http://www.w3.org/International/tests/results/results-css-encoding-detection


These tests examine whether user agents follow the rules in CSS 2.1 about detecting the encoding of CSS style sheets. This is particularly important if you style sheet uses non-ASCII characters in such things as class names, content, or font names.



Summary of initial results:

Of the user agents tested, only Firefox and IE8beta pass all tests.

IE7 doesn't recognise character encodings declared in either the HTTP header or the charset attribute of the link element.

Opera does not apply the encoding of the HTML file to the CSS in the absence of other cues to encoding, treating the CSS file as UTF-8. However, it doesn't default to UTF-8 or ISO Latin 1 if the encoding of the HTML is unknown. This means that you need to explicitly declare the encoding for CSS files if they contain characters beyond the Latin 1 range.

Safari appears, unusually, doesn't match any class in the HTML if @charset appears on the second line. It's not clear why.

The indications from the results are that if you have characters above the ASCII range in your CSS style sheet, you should either use the @charset rule, or use a byte-order mark at the beginning of a UTF-8 encoded file. Otherwise your style declarations may fail in one user agent or another.




============
Richard Ishida
Internationalization Lead
W3C (World Wide Web Consortium)

http://www.w3.org/International/
http://rishida.net/

Received on Monday, 11 August 2008 16:23:39 UTC