Skip to content

Commit d12fac4

Browse files
Force encoding label to utf-8 for DOMString record data (#522)
* Force encoding label to utf-8 for DOMString record data * nit
1 parent ab85f1c commit d12fac4

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

index.html

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,13 +2876,27 @@ <h3><dfn>Writing or pushing content</dfn></h3>
28762876
Let |language:string| be |record|'s <a>lang</a> if it [= map/exists =],
28772877
or else to |documentLanguage|.
28782878
</li>
2879-
<li>
2880-
Let |encoding label:string| be |record|'s <a>encoding</a> if it
2881-
[= map/exists =], or "`utf-8`".
2882-
</li>
2883-
<li>
2884-
If |encoding label| is not equal to "`utf-8`", "`utf-16`",
2885-
"`utf-16le`" or "`utf-16be`" [= exception/throw =] a {{TypeError}}.
2879+
<li>Switch on the type of |record|'s <a>data</a>:
2880+
<dl>
2881+
<dt>{{DOMString}}</dt>
2882+
<ol>
2883+
<li>
2884+
Let |encoding label:string| be "`utf-8`".
2885+
</li>
2886+
</ol>
2887+
<dt>{{BufferSource}}</dt>
2888+
<ol>
2889+
<li>
2890+
Let |encoding label:string| be |record|'s <a>encoding</a> if
2891+
it [= map/exists =], or else "`utf-8`".
2892+
</li>
2893+
<li>
2894+
If |encoding label| is not equal to "`utf-8`", "`utf-16`",
2895+
"`utf-16le`" or "`utf-16be`" [= exception/throw =] a
2896+
{{TypeError}}.
2897+
</li>
2898+
</ol>
2899+
</dl>
28862900
</li>
28872901
<li>
28882902
Let |encoding name| be the [=encoding/name|name=]

0 commit comments

Comments
 (0)