Skip to content

Commit 317401a

Browse files
authored
Editorial: add algorithm attribute to encoding sections
And rename unused I/O queue variables to unused. And also restore a newline I removed in the prior commit.
1 parent 00ef38e commit 317401a

File tree

1 file changed

+47
-48
lines changed

1 file changed

+47
-48
lines changed

encoding.bs

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ algorithms, as detailed in [[#implementation-considerations]].
248248
</div>
249249

250250

251+
251252
<h2 id=encodings>Encodings</h2>
252253

253254
<p>An <dfn export>encoding</dfn> defines a mapping from a <a>scalar value</a> sequence to
@@ -2116,7 +2117,7 @@ that are split between strings. [[!INFRA]]
21162117

21172118
<h3 id=utf-8 dfn export>UTF-8</h3>
21182119

2119-
<h4 id=utf-8-decoder dfn export>UTF-8 decoder</h4>
2120+
<h4 id=utf-8-decoder dfn algorithm export>UTF-8 decoder</h4>
21202121

21212122
<p class=note>A byte order mark has priority over a label as it has been found to be more accurate
21222123
in deployed content. Therefore it is not part of the <a>UTF-8 decoder</a> algorithm, but rather the
@@ -2242,10 +2243,10 @@ achieve the same result are fine, even encouraged).
22422243
[[!UNICODE]]
22432244

22442245

2245-
<h4 id=utf-8-encoder dfn export>UTF-8 encoder</h4>
2246+
<h4 id=utf-8-encoder dfn algorithm export>UTF-8 encoder</h4>
22462247

2247-
<p><a>UTF-8</a>'s <a for=/>encoder</a>'s <a>handler</a>, given
2248-
<var>ioQueue</var> and <var>code point</var>, runs these steps:
2248+
<p><a>UTF-8</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
2249+
<var>code point</var>, runs these steps:
22492250

22502251
<ol>
22512252
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return
@@ -2340,11 +2341,10 @@ historically this might have been the case for <a>ISO-8859-6</a> and
23402341
"ISO-8859-6-I" as well, that is no longer true.
23412342
<!-- https://www.w3.org/Bugs/Public/show_bug.cgi?id=19505 -->
23422343

2343-
<h3 id=single-byte-decoder dfn export>single-byte decoder</h3>
2344+
<h3 id=single-byte-decoder dfn algorithm export>single-byte decoder</h3>
23442345

2345-
<p><a>Single-byte encodings</a>'s
2346-
<a for=/>decoder</a>'s <a>handler</a>, given <var>ioQueue</var> and
2347-
<var>byte</var>, runs these steps:
2346+
<p><a>Single-byte encodings</a>'s <a for=/>decoder</a>'s <a>handler</a>, given
2347+
<var ignore>unused</var> and <var>byte</var>, runs these steps:
23482348

23492349
<ol>
23502350
<li><p>If <var>byte</var> is <a>end-of-queue</a>, return
@@ -2361,11 +2361,10 @@ historically this might have been the case for <a>ISO-8859-6</a> and
23612361
<li><p>Return a code point whose value is <var>code point</var>.
23622362
</ol>
23632363

2364-
<h3 id=single-byte-encoder export dfn>single-byte encoder</h3>
2364+
<h3 id=single-byte-encoder dfn algorithm export>single-byte encoder</h3>
23652365

2366-
<p><a>Single-byte encodings</a>'s
2367-
<a for=/>encoder</a>'s <a>handler</a>, given <var>ioQueue</var> and
2368-
<var>code point</var>, runs these steps:
2366+
<p><a>Single-byte encodings</a>'s <a for=/>encoder</a>'s <a>handler</a>, given
2367+
<var ignore>unused</var> and <var>code point</var>, runs these steps:
23692368

23702369
<ol>
23712370
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return
@@ -2389,12 +2388,12 @@ historically this might have been the case for <a>ISO-8859-6</a> and
23892388

23902389
<h3 id=gbk dfn export>GBK</h3>
23912390

2392-
<h4 id=gbk-decoder dfn export>GBK decoder</h4>
2391+
<h4 id=gbk-decoder dfn algorithm export>GBK decoder</h4>
23932392

23942393
<p><a>GBK</a>'s <a for=/>decoder</a> is <a>gb18030</a>'s <a for=/>decoder</a>.
23952394

23962395

2397-
<h4 id=gbk-encoder dfn export>GBK encoder</h4>
2396+
<h4 id=gbk-encoder dfn algorithm export>GBK encoder</h4>
23982397

23992398
<p><a>GBK</a>'s <a for=/>encoder</a> is <a>gb18030</a>'s <a for=/>encoder</a>
24002399
with its <a>is GBK</a> set to true.
@@ -2406,7 +2405,7 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
24062405

24072406
<h3 id=gb18030 dfn export>gb18030</h3>
24082407

2409-
<h4 id=gb18030-decoder dfn export>gb18030 decoder</h4>
2408+
<h4 id=gb18030-decoder dfn algorithm export>gb18030 decoder</h4>
24102409

24112410
<p><a>gb18030</a>'s <a for=/>decoder</a> has an associated <dfn>gb18030 first</dfn>,
24122411
<dfn>gb18030 second</dfn>, and <dfn>gb18030 third</dfn> (all initially 0x00).
@@ -2503,13 +2502,13 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
25032502
</ol>
25042503

25052504

2506-
<h4 id=gb18030-encoder dfn export>gb18030 encoder</h4>
2505+
<h4 id=gb18030-encoder dfn algorithm export>gb18030 encoder</h4>
25072506

25082507
<p><a>gb18030</a>'s <a for=/>encoder</a> has an associated <dfn id=gbk-flag>is GBK</dfn>
25092508
(initially false).
25102509

2511-
<p><a>gb18030</a>'s <a for=/>encoder</a>'s <a>handler</a>, given
2512-
<var>ioQueue</var> and <var>code point</var>, runs these steps:
2510+
<p><a>gb18030</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
2511+
<var>code point</var>, runs these steps:
25132512

25142513
<ol>
25152514
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return
@@ -2647,7 +2646,7 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
26472646

26482647
<h3 id=big5 dfn export>Big5</h3>
26492648

2650-
<h4 id=big5-decoder dfn export>Big5 decoder</h4>
2649+
<h4 id=big5-decoder dfn algorithm export>Big5 decoder</h4>
26512650

26522651
<p><a>Big5</a>'s <a for=/>decoder</a> has an associated
26532652
<dfn>Big5 lead</dfn> (initially 0x00).
@@ -2714,10 +2713,10 @@ and <var>byte</var>, runs these steps:
27142713
</ol>
27152714

27162715

2717-
<h4 id=big5-encoder dfn export>Big5 encoder</h4>
2716+
<h4 id=big5-encoder dfn algorithm export>Big5 encoder</h4>
27182717

2719-
<p><a>Big5</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var>ioQueue</var>
2720-
and <var>code point</var>, runs these steps:
2718+
<p><a>Big5</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
2719+
<var>code point</var>, runs these steps:
27212720

27222721
<ol>
27232722
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return
@@ -2750,7 +2749,7 @@ and <var>code point</var>, runs these steps:
27502749
<h3 id=euc-jp dfn export>EUC-JP</h3>
27512750
<!-- https://www.iana.org/assignments/charset-reg/CP51932 -->
27522751

2753-
<h4 id=euc-jp-decoder dfn export>EUC-JP decoder</h4>
2752+
<h4 id=euc-jp-decoder dfn algorithm export>EUC-JP decoder</h4>
27542753

27552754
<p><a>EUC-JP</a>'s <a for=/>decoder</a> has an associated
27562755
<dfn id=euc-jp-jis0212-flag>EUC-JP jis0212</dfn> (initially false) and
@@ -2811,10 +2810,10 @@ and <var>code point</var>, runs these steps:
28112810
</ol>
28122811

28132812

2814-
<h4 id=euc-jp-encoder dfn export>EUC-JP encoder</h4>
2813+
<h4 id=euc-jp-encoder dfn algorithm export>EUC-JP encoder</h4>
28152814

2816-
<p><a>EUC-JP</a>'s <a for=/>encoder</a>'s <a>handler</a>, given
2817-
<var>ioQueue</var> and <var>code point</var>, runs these steps:
2815+
<p><a>EUC-JP</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
2816+
<var>code point</var>, runs these steps:
28182817

28192818
<ol>
28202819
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return
@@ -2858,7 +2857,7 @@ and <var>code point</var>, runs these steps:
28582857
"ESC ) I" is from ISO-2022-JP-3 reportedly
28592858
-->
28602859

2861-
<h4 id=iso-2022-jp-decoder dfn export>ISO-2022-JP decoder</h4>
2860+
<h4 id=iso-2022-jp-decoder dfn algorithm export>ISO-2022-JP decoder</h4>
28622861

28632862
<p><a>ISO-2022-JP</a>'s <a for=/>decoder</a> has an associated
28642863
<dfn>ISO-2022-JP decoder state</dfn> (initially
@@ -3067,7 +3066,7 @@ and <var>code point</var>, runs these steps:
30673066
</dl>
30683067

30693068

3070-
<h4 id=iso-2022-jp-encoder dfn export>ISO-2022-JP encoder</h4>
3069+
<h4 id=iso-2022-jp-encoder dfn algorithm export>ISO-2022-JP encoder</h4>
30713070

30723071
<div class="note no-backref">
30733072
<p>The <a>ISO-2022-JP encoder</a> is the only <a for=/>encoder</a> for which the concatenation of
@@ -3186,7 +3185,7 @@ and <var>code point</var>, runs these steps:
31863185

31873186
<h3 id=shift_jis dfn export>Shift_JIS</h3>
31883187

3189-
<h4 id=shift_jis-decoder dfn export>Shift_JIS decoder</h4>
3188+
<h4 id=shift_jis-decoder dfn algorithm export>Shift_JIS decoder</h4>
31903189

31913190
<p><a>Shift_JIS</a>'s <a for=/>decoder</a> has an associated
31923191
<dfn>Shift_JIS lead</dfn> (initially 0x00).
@@ -3251,10 +3250,10 @@ and <var>code point</var>, runs these steps:
32513250
</ol>
32523251

32533252

3254-
<h4 id=shift_jis-encoder dfn export>Shift_JIS encoder</h4>
3253+
<h4 id=shift_jis-encoder dfn algorithm export>Shift_JIS encoder</h4>
32553254

3256-
<p><a>Shift_JIS</a>'s <a for=/>encoder</a>'s <a>handler</a>, given
3257-
<var>ioQueue</var> and <var>code point</var>, runs these steps:
3255+
<p><a>Shift_JIS</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
3256+
<var>code point</var>, runs these steps:
32583257

32593258
<ol>
32603259
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return
@@ -3298,7 +3297,7 @@ and <var>code point</var>, runs these steps:
32983297

32993298
<h3 id=euc-kr dfn export>EUC-KR</h3>
33003299

3301-
<h4 id=euc-kr-decoder dfn export>EUC-KR decoder</h4>
3300+
<h4 id=euc-kr-decoder dfn algorithm export>EUC-KR decoder</h4>
33023301

33033302
<p><a>EUC-KR</a>'s <a for=/>decoder</a> has an associated
33043303
<dfn>EUC-KR lead</dfn> (initially 0x00).
@@ -3345,10 +3344,10 @@ and <var>code point</var>, runs these steps:
33453344
</ol>
33463345

33473346

3348-
<h4 id=euc-kr-encoder dfn export>EUC-KR encoder</h4>
3347+
<h4 id=euc-kr-encoder dfn algorithm export>EUC-KR encoder</h4>
33493348

3350-
<p><a>EUC-KR</a>'s <a for=/>encoder</a>'s <a>handler</a>, given
3351-
<var>ioQueue</var> and <var>code point</var>, runs these steps:
3349+
<p><a>EUC-KR</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
3350+
<var>code point</var>, runs these steps:
33523351

33533352
<ol>
33543353
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return
@@ -3381,13 +3380,13 @@ attacks that abuse a mismatch between <a for=/>encodings</a> supported on
33813380
the server and the client.
33823381

33833382

3384-
<h4 id=replacement-decoder dfn export>replacement decoder</h4>
3383+
<h4 id=replacement-decoder dfn algorithm export>replacement decoder</h4>
33853384

33863385
<p><a>replacement</a>'s <a for=/>decoder</a> has an associated
33873386
<dfn id=replacement-error-returned-flag>replacement error returned</dfn> (initially false).
33883387

3389-
<p><a>replacement</a>'s <a for=/>decoder</a>'s <a>handler</a>, given
3390-
<var>ioQueue</var> and <var>byte</var>, runs these steps:
3388+
<p><a>replacement</a>'s <a for=/>decoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
3389+
<var>byte</var>, runs these steps:
33913390

33923391
<ol>
33933392
<li><p>If <var>byte</var> is <a>end-of-queue</a>, return <a>finished</a>.
@@ -3404,7 +3403,7 @@ the server and the client.
34043403
<p><dfn export>UTF-16BE/LE</dfn> is <a>UTF-16BE</a> or <a>UTF-16LE</a>.
34053404

34063405

3407-
<h4 id=shared-utf-16-decoder dfn export>shared UTF-16 decoder</h4>
3406+
<h4 id=shared-utf-16-decoder dfn algorithm export>shared UTF-16 decoder</h4>
34083407

34093408
<p class=note>A byte order mark has priority over a label as it has been found to be more accurate
34103409
in deployed content. Therefore it is not part of the <a>shared UTF-16 decoder</a> algorithm, but
@@ -3475,7 +3474,7 @@ rather the <a>decode</a> algorithm.
34753474

34763475
<h3 id=utf-16be dfn export>UTF-16BE</h3>
34773476

3478-
<h4 id=utf-16be-decoder dfn export>UTF-16BE decoder</h4>
3477+
<h4 id=utf-16be-decoder dfn algorithm export>UTF-16BE decoder</h4>
34793478

34803479
<p><a>UTF-16BE</a>'s <a for=/>decoder</a> is <a>shared UTF-16 decoder</a> with
34813480
its <a>is UTF-16BE decoder</a> set to true.
@@ -3487,7 +3486,7 @@ its <a>is UTF-16BE decoder</a> set to true.
34873486
deployed content.
34883487

34893488

3490-
<h4 id=utf-16le-decoder dfn export>UTF-16LE decoder</h4>
3489+
<h4 id=utf-16le-decoder dfn algorithm export>UTF-16LE decoder</h4>
34913490

34923491
<p><a>UTF-16LE</a>'s <a for=/>decoder</a> is <a>shared UTF-16 decoder</a>.
34933492

@@ -3506,10 +3505,10 @@ https://krijnhoetmer.nl/irc-logs/whatwg/20121010#l-812
35063505
https://stackoverflow.com/questions/6986789/why-are-some-bytes-prefixed-with-0xf7-when-using-charset-x-user-defined-with-xm
35073506
-->
35083507

3509-
<h4 id=x-user-defined-decoder dfn export>x-user-defined decoder</h4>
3508+
<h4 id=x-user-defined-decoder dfn algorithm export>x-user-defined decoder</h4>
35103509

3511-
<p><a>x-user-defined</a>'s <a for=/>decoder</a>'s <a>handler</a>, given
3512-
<var>ioQueue</var> and <var>byte</var>, runs these steps:
3510+
<p><a>x-user-defined</a>'s <a for=/>decoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
3511+
<var>byte</var>, runs these steps:
35133512

35143513
<ol>
35153514
<li><p>If <var>byte</var> is <a>end-of-queue</a>, return
@@ -3522,10 +3521,10 @@ https://stackoverflow.com/questions/6986789/why-are-some-bytes-prefixed-with-0xf
35223521
</ol>
35233522

35243523

3525-
<h4 id=x-user-defined-encoder dfn export>x-user-defined encoder</h4>
3524+
<h4 id=x-user-defined-encoder dfn algorithm export>x-user-defined encoder</h4>
35263525

3527-
<p><a>x-user-defined</a>'s <a for=/>encoder</a>'s <a>handler</a>, given
3528-
<var>ioQueue</var> and <var>code point</var>, runs these steps:
3526+
<p><a>x-user-defined</a>'s <a for=/>encoder</a>'s <a>handler</a>, given <var ignore>unused</var> and
3527+
<var>code point</var>, runs these steps:
35293528

35303529
<ol>
35313530
<li><p>If <var>code point</var> is <a>end-of-queue</a>, return

0 commit comments

Comments
 (0)