@@ -248,6 +248,7 @@ algorithms, as detailed in [[#implementation-considerations]].
248
248
</div>
249
249
250
250
251
+
251
252
<h2 id=encodings>Encodings</h2>
252
253
253
254
<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]]
2116
2117
2117
2118
<h3 id=utf-8 dfn export>UTF-8</h3>
2118
2119
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>
2120
2121
2121
2122
<p class=note> A byte order mark has priority over a label as it has been found to be more accurate
2122
2123
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).
2242
2243
[[!UNICODE]]
2243
2244
2244
2245
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>
2246
2247
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:
2249
2250
2250
2251
<ol>
2251
2252
<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
2340
2341
"ISO-8859-6-I" as well, that is no longer true.
2341
2342
<!-- https://www.w3.org/Bugs/Public/show_bug.cgi?id=19505 -->
2342
2343
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>
2344
2345
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:
2348
2348
2349
2349
<ol>
2350
2350
<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
2361
2361
<li><p> Return a code point whose value is <var> code point</var> .
2362
2362
</ol>
2363
2363
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>
2365
2365
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:
2369
2368
2370
2369
<ol>
2371
2370
<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
2389
2388
2390
2389
<h3 id=gbk dfn export>GBK</h3>
2391
2390
2392
- <h4 id=gbk-decoder dfn export>GBK decoder</h4>
2391
+ <h4 id=gbk-decoder dfn algorithm export>GBK decoder</h4>
2393
2392
2394
2393
<p> <a>GBK</a> 's <a for=/>decoder</a> is <a>gb18030</a>' s <a for=/>decoder</a> .
2395
2394
2396
2395
2397
- <h4 id=gbk-encoder dfn export>GBK encoder</h4>
2396
+ <h4 id=gbk-encoder dfn algorithm export>GBK encoder</h4>
2398
2397
2399
2398
<p> <a>GBK</a> 's <a for=/>encoder</a> is <a>gb18030</a>' s <a for=/>encoder</a>
2400
2399
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>.
2406
2405
2407
2406
<h3 id=gb18030 dfn export>gb18030</h3>
2408
2407
2409
- <h4 id=gb18030-decoder dfn export>gb18030 decoder</h4>
2408
+ <h4 id=gb18030-decoder dfn algorithm export>gb18030 decoder</h4>
2410
2409
2411
2410
<p> <a>gb18030</a> 's <a for=/>decoder</a> has an associated <dfn>gb18030 first</dfn> ,
2412
2411
<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>.
2503
2502
</ol>
2504
2503
2505
2504
2506
- <h4 id=gb18030-encoder dfn export>gb18030 encoder</h4>
2505
+ <h4 id=gb18030-encoder dfn algorithm export>gb18030 encoder</h4>
2507
2506
2508
2507
<p> <a>gb18030</a> 's <a for=/>encoder</a> has an associated <dfn id=gbk-flag>is GBK</dfn>
2509
2508
(initially false).
2510
2509
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:
2513
2512
2514
2513
<ol>
2515
2514
<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>.
2647
2646
2648
2647
<h3 id=big5 dfn export>Big5</h3>
2649
2648
2650
- <h4 id=big5-decoder dfn export>Big5 decoder</h4>
2649
+ <h4 id=big5-decoder dfn algorithm export>Big5 decoder</h4>
2651
2650
2652
2651
<p> <a>Big5</a> 's <a for=/>decoder</a> has an associated
2653
2652
<dfn>Big5 lead</dfn> (initially 0x00).
@@ -2714,10 +2713,10 @@ and <var>byte</var>, runs these steps:
2714
2713
</ol>
2715
2714
2716
2715
2717
- <h4 id=big5-encoder dfn export>Big5 encoder</h4>
2716
+ <h4 id=big5-encoder dfn algorithm export>Big5 encoder</h4>
2718
2717
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:
2721
2720
2722
2721
<ol>
2723
2722
<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:
2750
2749
<h3 id=euc-jp dfn export>EUC-JP</h3>
2751
2750
<!-- https://www.iana.org/assignments/charset-reg/CP51932 -->
2752
2751
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>
2754
2753
2755
2754
<p> <a>EUC-JP</a> 's <a for=/>decoder</a> has an associated
2756
2755
<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:
2811
2810
</ol>
2812
2811
2813
2812
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>
2815
2814
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:
2818
2817
2819
2818
<ol>
2820
2819
<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:
2858
2857
"ESC ) I" is from ISO-2022-JP-3 reportedly
2859
2858
-->
2860
2859
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>
2862
2861
2863
2862
<p> <a>ISO-2022-JP</a> 's <a for=/>decoder</a> has an associated
2864
2863
<dfn>ISO-2022-JP decoder state</dfn> (initially
@@ -3067,7 +3066,7 @@ and <var>code point</var>, runs these steps:
3067
3066
</dl>
3068
3067
3069
3068
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>
3071
3070
3072
3071
<div class="note no-backref">
3073
3072
<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:
3186
3185
3187
3186
<h3 id=shift_jis dfn export>Shift_JIS</h3>
3188
3187
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>
3190
3189
3191
3190
<p> <a>Shift_JIS</a> 's <a for=/>decoder</a> has an associated
3192
3191
<dfn>Shift_JIS lead</dfn> (initially 0x00).
@@ -3251,10 +3250,10 @@ and <var>code point</var>, runs these steps:
3251
3250
</ol>
3252
3251
3253
3252
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>
3255
3254
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:
3258
3257
3259
3258
<ol>
3260
3259
<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:
3298
3297
3299
3298
<h3 id=euc-kr dfn export>EUC-KR</h3>
3300
3299
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>
3302
3301
3303
3302
<p> <a>EUC-KR</a> 's <a for=/>decoder</a> has an associated
3304
3303
<dfn>EUC-KR lead</dfn> (initially 0x00).
@@ -3345,10 +3344,10 @@ and <var>code point</var>, runs these steps:
3345
3344
</ol>
3346
3345
3347
3346
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>
3349
3348
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:
3352
3351
3353
3352
<ol>
3354
3353
<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
3381
3380
the server and the client.
3382
3381
3383
3382
3384
- <h4 id=replacement-decoder dfn export>replacement decoder</h4>
3383
+ <h4 id=replacement-decoder dfn algorithm export>replacement decoder</h4>
3385
3384
3386
3385
<p> <a>replacement</a> 's <a for=/>decoder</a> has an associated
3387
3386
<dfn id=replacement-error-returned-flag>replacement error returned</dfn> (initially false).
3388
3387
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:
3391
3390
3392
3391
<ol>
3393
3392
<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.
3404
3403
<p> <dfn export>UTF-16BE/LE</dfn> is <a>UTF-16BE</a> or <a>UTF-16LE</a> .
3405
3404
3406
3405
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>
3408
3407
3409
3408
<p class=note> A byte order mark has priority over a label as it has been found to be more accurate
3410
3409
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.
3475
3474
3476
3475
<h3 id=utf-16be dfn export>UTF-16BE</h3>
3477
3476
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>
3479
3478
3480
3479
<p> <a>UTF-16BE</a> 's <a for=/>decoder</a> is <a>shared UTF-16 decoder</a> with
3481
3480
its <a>is UTF-16BE decoder</a> set to true.
@@ -3487,7 +3486,7 @@ its <a>is UTF-16BE decoder</a> set to true.
3487
3486
deployed content.
3488
3487
3489
3488
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>
3491
3490
3492
3491
<p> <a>UTF-16LE</a> 's <a for=/>decoder</a> is <a>shared UTF-16 decoder</a> .
3493
3492
@@ -3506,10 +3505,10 @@ https://krijnhoetmer.nl/irc-logs/whatwg/20121010#l-812
3506
3505
https://stackoverflow.com/questions/6986789/why-are-some-bytes-prefixed-with-0xf7-when-using-charset-x-user-defined-with-xm
3507
3506
-->
3508
3507
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>
3510
3509
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:
3513
3512
3514
3513
<ol>
3515
3514
<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
3522
3521
</ol>
3523
3522
3524
3523
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>
3526
3525
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:
3529
3528
3530
3529
<ol>
3531
3530
<li><p> If <var> code point</var> is <a>end-of-queue</a> , return
0 commit comments