This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20075 - The parser takes as invalid the @charset css at-rule if the value is between single quotes (')
Summary: The parser takes as invalid the @charset css at-rule if the value is between ...
Status: RESOLVED INVALID
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: Parser (show other bugs)
Version: CSS Validator
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-25 18:58 UTC by matias_10323
Modified: 2012-11-28 14:13 UTC (History)
0 users

See Also:


Attachments

Description matias_10323 2012-11-25 18:58:18 UTC
The parser takes as invalid the @charset css at-rule if the value is between single quotes, also known as apostrophe ('). But I've seen examples of this is valid in MDN (https://developer.mozilla.org/en/docs/CSS/@charset). I have also created many css stylesheets using apostrophes (') instead of double quotes (") and I've never had any problems of any kind.

eg.:
@charset 'UTF-8';
is taken as invalid. but:
@charset "UTF-8";
is taken as valid. when truly both are valid.
Comment 1 Yves Lafon 2012-11-28 14:13:38 UTC
From CSS21:
http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#charset
<<
After "@charset", authors specify the name of a character encoding (in quotes). For example:

@charset "ISO-8859-1";

@charset must be written literally, i.e., the 10 characters '@charset "' (lowercase, no backslash escapes), followed by the encoding name, followed by '";'. 
>>
So @charset        "XXX"; is not accepted, and @charset 'XXX'; is also not accepted.
Cheers,