Skip to content

Commit 2054b0e

Browse files
committed
[css-syntax] Clarify @charest vs. ASCII-incompatible encodings.
1 parent 8164476 commit 2054b0e

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

css-syntax/Overview.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</p>
5555
<h1 class="p-name no-ref" id=title>CSS Syntax Module Level 3</h1>
5656
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
57-
<span class=dt-updated><span class=value-title title=20140103>3 January 2014</span></span></span></h2>
57+
<span class=dt-updated><span class=value-title title=20140108>8 January 2014</span></span></span></h2>
5858
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-syntax/>http://dev.w3.org/csswg/css-syntax/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-syntax-3/>http://www.w3.org/TR/css-syntax-3/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-syntax/>http://dev.w3.org/csswg/css-syntax/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2013/WD-css-syntax-3-20131105/ rel=previous>http://www.w3.org/TR/2013/WD-css-syntax-3-20131105/</a><dd><a href=http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/ rel=previous>http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/</a>
5959
<dt>Feedback:</dt>
6060
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-syntax%5D%20feedback">www-style@w3.org</a>
@@ -464,12 +464,17 @@ <h3 class="heading settled heading" data-level=3.2 id=input-byte-stream><span cl
464464
is the string "<code>@charset "…";</code>",
465465
where the "…" is the sequence of bytes corresponding to the encoding’s label.
466466

467-
<p> If the return value was <code>utf-16</code> or <code>utf-16be</code>,
467+
<p> If the return value was <code>utf-16be</code> or <code>utf-16le</code>,
468468
use <code>utf-8</code> as the fallback encoding;
469469
if it was anything else except failure,
470470
use the return value as the fallback encoding.
471471

472-
<p class=note> Note: This mimics HTML <code>&lt;meta&gt;</code> behavior.
472+
<p class=note> Note: UTF-16BE and UTF-16LE are the only ASCII-incompatible encodings that
473+
<a href=http://encoding.spec.whatwg.org/#concept-encoding-get>get an encoding</a>
474+
can return.
475+
Using one of them to decode the ASCII <code>@charset "…";</code> byte sequence
476+
would result in garbage.
477+
This mimics HTML <code>&lt;meta&gt;</code> behavior.
473478

474479
<li>
475480
Otherwise, if an <a data-link-type=dfn href=#environment-encoding0 title="environment encoding">environment encoding</a> is provided by the referring document,

css-syntax/Overview.src.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,17 @@ <h3 id="input-byte-stream">
301301
is the string "<code>@charset "…";</code>",
302302
where the "…" is the sequence of bytes corresponding to the encoding's label.
303303

304-
If the return value was <code>utf-16</code> or <code>utf-16be</code>,
304+
If the return value was <code>utf-16be</code> or <code>utf-16le</code>,
305305
use <code>utf-8</code> as the fallback encoding;
306306
if it was anything else except failure,
307307
use the return value as the fallback encoding.
308308

309-
Note: This mimics HTML <code>&lt;meta></code> behavior.
309+
Note: UTF-16BE and UTF-16LE are the only ASCII-incompatible encodings that
310+
<a href="http://encoding.spec.whatwg.org/#concept-encoding-get">get an encoding</a>
311+
can return.
312+
Using one of them to decode the ASCII <code>@charset "…";</code> byte sequence
313+
would result in garbage.
314+
This mimics HTML <code>&lt;meta></code> behavior.
310315

311316
<li>
312317
Otherwise, if an <a>environment encoding</a> is provided by the referring document,

0 commit comments

Comments
 (0)