Character encoding in CSS

Hello,

I didn't find anything in the CSS1 or CSS2 specifications indicating how to declare encoding for a CSS file. It's clearly defined how to encode UCS characters with the \HHH mechanism, but if comments are in a given language the encoding of the file should be able to support it.
I also noticed that Netscape 6 treats CSS file as iso-8859-1, regardless the encoding declaration of the calling XML document and/or the encoding of the CSS file itself. It also not seems to supports UTF-16 CSS files.

Based on those tries I came up with the following answers to my questions. Is this correct?

Question: How to declare encoding for CSS file?
Assumed Answer: You don't: it will be treated as iso-8859-1 and all the meaningful characters (the ones in properties: font names, content, quotes, etc. as well as the one in identifiers (selectors, IDs, class names, etc.)) should always be coded with the \HHH mechanism. Comments can be in any 8-bit encodings you want: it's doesn't bother the processors.

Question: Can you have CSS files encoded in UTF-16?
Assumed Answer: No, or at least, it's not required from the CSS parsers to support it.

Question: How CSS imported with an @import rule behave?
Assumed Answer: Imported CSS are interpreted independently from the calling CSS, they could be in a different encoding, once parsed the text is in UCS regardless the original encoding.

Thanks
-yves

Received on Monday, 6 November 2000 10:55:52 UTC