Re: [CSS21] Ambiguity relating to character spacing within @charset rule

James Hopkins wrote:
> Regarding @charset rule constructs, the current spec states ,"@charset 
> must be written literally, i.e., the 10 characters '@charset "' 
> (lowercase, no backslash escapes), followed by the encoding name, 
> followed by '";' ". It does not mention whether a character space is 
> required between the '@charset' string and the succeeding encoding name.

It requires precisely one ASCII space between the 't' and the '"' that 
precedes the encoding name, no?  That seems pretty unambiguous to me.

> Firefox 3, Opera and Safari all parse styles within a block (where there 
> is no character space), whereas IE8 does not

Note that the specification changed in this area recently; Firefox 3.1 
will be implementing the current text.  The specific changes made from 
Firefox 3 were:

1)  Requiring precisely one ASCII space after the 't' (instead of the
     old behavior, which required 0 or more ASCII spaces, carriage
     returns, line feeds, or horizontal tabs).
2)  Requring the charset name to be enclosed in double quotes
     (previously both single or double quotes were allowed).
3)  Disallowing inclusion of the quote character used (now always a
     double quote) in the charset name (previously it could be included
     by preceding it with a backslash).
4)  Disallowing whitespace between the ending quote and the ';'
     (previously ASCII spaces, carriage returns, line feeds, or
     horizontal tabs were allowed there).

-Boris

Received on Sunday, 8 February 2009 04:02:06 UTC