- From: Tex Texin <tex@i18nguy.com>
- Date: Wed, 24 Sep 2003 05:49:48 -0400
- To: Russ Rolfe <rrolfe@windows.microsoft.com>
- Cc: public-i18n-geo@w3.org
Russ, Looks good! A couple suggestions: 1) Maybe in the background add a note that it won't really be left to chance, since there are rules that determine the encoding if it isn't specified in the sheet. 2) Instead of quoting the spec, perhaps restate it in your own words. a) I think people look to faqs because they dont understand spec-speak. b) Your version will be more clear. (I am sure!) c) The spec uses that hateful 2 steps of indirection to references, and you can link [charsets] directly from your text, which is more useful if not usable. Otherwise people have to figure out that the quote of "[charsets]" is the same as the link you provide further on. Anyone want to create a separate faq on where non-ascii characters can be used in a stylesheet? Maybe we should add one sentence in this faq saying where non-ascii might be used? Otherwise people might wonder why bother with an encoding declaration? tex Russ Rolfe wrote: > > Here is my submission for this week. > > Regards, Russ > > -=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > Question? > > How do I declare the character encoding of a CSS (Cascading Style Sheets) style sheet? > > Answer: > > Just as you should always declare the character encoding for an HTML document <http://www.w3.org/TR/1998/REC-html40-19980424/charset.html#h-5.2.2> you should also declare the character encoding for a separate external style sheet file. This way it is not left to chance on how the style sheet's encoding will be interpreted. > > To set the character encoding you may use the "@charset at-rule". Its syntax is: > > @charset <IANA defined charset name> > > The CSS2 specification states: > > "At most one @charset rule may appear in an external style sheet -- it must not appear in an embedded style sheet -- and it must appear at the very start of the document, not preceded by any characters. After "@charset", authors specify the name of a character encoding. The name must be a charset name as described in the IANA registry (See [IANA]. Also, see [CHARSETS] for a complete list of charsets)." > > The important thing to note here is that this command must appear at the very beginning of the file -- even before any comments. > > Thus an example of labeling your CSS file as UTF-8 encoded would be: > > @charset "UTF-8" > > References: > > CSS 2.1 @charset spec http://www.w3.org/TR/CSS21/syndata.html#x60 > CSS 2.0 @charset spec http://www.w3.org/TR/CSS2/syndata.html#q23 > IANA Charset Names http://www.iana.org/assignments/character-sets > HTML 4.0 Specify the Character Encoding > http://www.w3.org/TR/1998/REC-html40-19980424/charset.html#h-5.2.2 -- ------------------------------------------------------------- Tex Texin cell: +1 781 789 1898 mailto:Tex@XenCraft.com Xen Master http://www.i18nGuy.com XenCraft http://www.XenCraft.com Making e-Business Work Around the World -------------------------------------------------------------
Received on Wednesday, 24 September 2003 05:52:23 UTC