@@ -16,7 +16,7 @@ Markup Shorthands: css off
16
16
!Commits : <a href=https://twitter.com/encodings>@encodings</a>
17
17
!Tests : <a href=https://github.com/w3c/web-platform-tests/tree/master/encoding>web-platform-tests encoding/</a> (<a href=https://github.com/w3c/web-platform-tests/labels/encoding>ongoing work</a>)
18
18
!Translation (non-normative): <span title=Japanese><a href=https://triple-underscore.github.io/Encoding-ja.html lang=ja hreflang=ja rel=alternate>日本語</a></span>
19
- Translate IDs : dictdef-textdecoderoptions textdecoderoptions,dictdef-textdecodeoptions textdecodeoptions
19
+ Translate IDs : dictdef-textdecoderoptions textdecoderoptions,dictdef-textdecodeoptions textdecodeoptions,index section-index
20
20
</pre>
21
21
22
22
<link rel=stylesheet href=visualization-colors.css>
@@ -624,7 +624,7 @@ form submission, which both need exactly this.
624
624
625
625
<h2 id=indexes>Indexes</h2>
626
626
627
- <p> Most legacy <a for=/>encodings</a> make use of an <dfn>index</dfn> . An
627
+ <p> Most legacy <a for=/>encodings</a> make use of an <dfn id=index >index</dfn> . An
628
628
<a>index</a> is an ordered list of entries, each entry consisting of a pointer and a
629
629
corresponding code point. Within an <a>index</a> pointers are unique and code points can be
630
630
duplicated.
@@ -1113,7 +1113,7 @@ control.
1113
1113
<hr>
1114
1114
1115
1115
<dl class=domintro>
1116
- <dt><code><var> decoder</var> = new <a constructor for=TextDecoder>TextDecoder([<var>label</var> = "utf-8" [, <var>options</var>]])</a> </code>
1116
+ <dt><code><var> decoder</var> = new <a constructor for=TextDecoder lt=TextDecoder() >TextDecoder([<var>label</var> = "utf-8" [, <var>options</var>]])</a> </code>
1117
1117
<dd>
1118
1118
<p> Returns a new {{TextDecoder}} object.
1119
1119
<p> If <var> label</var> is either not a <a>label</a> or is a
@@ -1131,13 +1131,13 @@ control.
1131
1131
<dt><code><var> decoder</var> . <a attribute for=TextDecoder>ignoreBOM</a> </code>
1132
1132
<dd><p> Returns true if <a for=TextDecoder>ignore BOM flag</a> is set, and false otherwise.
1133
1133
1134
- <dt><code><var> decoder</var> . <a method for=TextDecoder>decode([<var>input</var> [, <var>options</var>]])</a> </code>
1134
+ <dt><code><var> decoder</var> . <a method for=TextDecoder lt=decode() >decode([<var>input</var> [, <var>options</var>]])</a> </code>
1135
1135
<dd>
1136
- <p> Returns the result of running <a for=TextDecoder>encoding</a> 's <a for=/>decoder</a> . The method can
1137
- be invoked zero or more times with <var> options</var> 's <code> stream</code> set to true, and then
1138
- once without <var> options</var> 's <code> stream</code> (or set to false), to process a fragmented
1139
- stream. If the invocation without <var> options</var> 's <code> stream</code> (or set to false) has
1140
- no <var> input</var> , it's clearest to omit both arguments.
1136
+ <p> Returns the result of running <a for=TextDecoder>encoding</a> 's <a for=/>decoder</a> . The
1137
+ method can be invoked zero or more times with <var> options</var> 's <code> stream</code> set to
1138
+ true, and then once without <var> options</var> 's <code> stream</code> (or set to false), to process
1139
+ a fragmented stream. If the invocation without <var> options</var> 's <code> stream</code> (or set to
1140
+ false) has no <var> input</var> , it's clearest to omit both arguments.
1141
1141
1142
1142
<pre class=example id=example-end-of-stream><code class=lang-javascript>
1143
1143
var string = "", decoder = new TextDecoder(encoding), buffer;
@@ -1187,8 +1187,8 @@ method, when invoked, must run these steps:
1187
1187
1188
1188
<ol>
1189
1189
<li><p> If the <a for=TextDecoder>do not flush flag</a> is unset, set <a for=TextDecoder>decoder</a>
1190
- to a new <a for=TextDecoder>encoding</a> 's <a for=/>decoder</a> , set <a for=TextDecoder>stream</a> to a
1191
- new <a for=/>stream</a> , and unset the <a for=TextDecoder>BOM seen flag</a> .
1190
+ to a new <a for=TextDecoder>encoding</a> 's <a for=/>decoder</a> , set <a for=TextDecoder>stream</a>
1191
+ to a new <a for=/>stream</a> , and unset the <a for=TextDecoder>BOM seen flag</a> .
1192
1192
1193
1193
<li><p> If <var> options</var> 's <code> stream</code> is true, set the
1194
1194
<a for=TextDecoder>do not flush flag</a> , and unset the <a for=TextDecoder>do not flush flag</a>
@@ -1216,8 +1216,9 @@ method, when invoked, must run these steps:
1216
1216
is set, then return <var> output</var> , <a lt="serialize stream">serialized</a> .
1217
1217
1218
1218
<p class=note> The way streaming works is to not handle <a>end-of-stream</a> here when the
1219
- <a for=TextDecoder>do not flush flag</a> is set and to not unset that flag. That way in a subsequent invocation
1220
- <a for=TextDecoder>decoder</a> is not set anew in the first step of the algorithm and its state is preserved.
1219
+ <a for=TextDecoder>do not flush flag</a> is set and to not unset that flag. That way in a
1220
+ subsequent invocation <a for=TextDecoder>decoder</a> is not set anew in the first step of the
1221
+ algorithm and its state is preserved.
1221
1222
1222
1223
<li>
1223
1224
<p> Otherwise:
@@ -1250,8 +1251,8 @@ interface TextEncoder {
1250
1251
<p> A {{TextEncoder}} object has an associated <dfn for=TextEncoder>encoder</dfn> .
1251
1252
1252
1253
<p class="note no-backref"> A {{TextEncoder}} object offers no <var> label</var> argument as it only
1253
- supports <a>UTF-8</a> . It also offers no <code> stream</code> option as no <a for=/>encoder</a> requires
1254
- buffering of scalar values.
1254
+ supports <a>UTF-8</a> . It also offers no <code> stream</code> option as no <a for=/>encoder</a>
1255
+ requires buffering of scalar values.
1255
1256
1256
1257
<hr>
1257
1258
@@ -1262,7 +1263,7 @@ buffering of scalar values.
1262
1263
<dt><code><var> encoder</var> . <a attribute for=TextEncoder>encoding</a> </code>
1263
1264
<dd><p> Returns "<code> utf-8</code> ".
1264
1265
1265
- <dt><code><var> encoder</var> . <a method for=TextEncoder>encode([<var>input</var> = ""])</a> </code>
1266
+ <dt><code><var> encoder</var> . <a method for=TextEncoder lt=encode() >encode([<var>input</var> = ""])</a> </code>
1266
1267
<dd><p> Returns the result of running <a>UTF-8</a> 's <a for=/>encoder</a> .
1267
1268
</dl>
1268
1269
@@ -2688,11 +2689,12 @@ issues. Browsers also should disable this feature if the resource was decoded us
2688
2689
<p> A single-byte buffer for <a>gb18030</a> (an <a>ASCII byte</a> ) and <a>ISO-2022-JP</a> (0x24 or
2689
2690
0x28).
2690
2691
2691
- <p class="example"> For <a>gb18030</a> when hitting a bogus byte while <a>gb18030 third</a> is not
2692
- 0x00, <a>gb18030 second</a> could be moved into the single-byte buffer to be returned next, and
2693
- <a>gb18030 third</a> would be the new <a>gb18030 first</a> , checked for not being 0x00 after the
2694
- single-byte buffer was returned and emptied. This is possible as the range for the first and third
2695
- byte in <a>gb18030</a> is identical.
2692
+ <p class=example id=example-gb18030-implementation-strategy> For <a>gb18030</a> when hitting a
2693
+ bogus byte while <a>gb18030 third</a> is not 0x00, <a>gb18030 second</a> could be moved into the
2694
+ single-byte buffer to be returned next, and <a>gb18030 third</a> would be the new
2695
+ <a>gb18030 first</a> , checked for not being 0x00 after the single-byte buffer was returned and
2696
+ emptied. This is possible as the range for the first and third byte in <a>gb18030</a> is
2697
+ identical.
2696
2698
</ol>
2697
2699
2698
2700
<p> The <a>ISO-2022-JP encoder</a> needs <a>ISO-2022-JP encoder state</a> as additional state, but
0 commit comments