W3C home > Mailing lists > Public > www-style@w3.org > February 2009

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sat, 07 Feb 2009 22:57:55 -0500
Message-ID: <498E5843.2050804@mit.edu>
To: James Hopkins <james@idreamincode.co.uk>
CC: www-style@w3.org

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).

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:24 UTC