Re: [whatwg/encoding] Make TextEncoder and TextDecoder be transform streams (#127)

ricea commented on this pull request.



> @@ -1314,6 +1528,120 @@ must run these steps:
   </ol>
 </ol>
 
+<hr>
+
+<p>The <dfn id=concept-te-encode-and-enqueue>encode and enqueue a chunk</dfn> algorithm, given a
+{{TextEncoder}} <var>encForTransform</var> and <var>chunk</var>, runs these steps:
+
+<ol>
+ <li><p>Let <var>input</var> be the result of <a lt="converted to an IDL value">converting</a>
+ <var>chunk</var> to a {{DOMString}}. If this throws an exception, then return a promise rejected
+ with that exception.
+
+ <p class=note>{{DOMString}} is used here so that a surrogate pair that is split between chunks can
+ be correctly reassembled into the appropriate code point in the output. The behaviour is otherwise
+ identical to {{USVString}}. In particular, replacement characters will be used where necessary to
+ make the output valid UTF-8.

A couple of options I can think of

1. Stop mentioning UTF-8 in this note altogether.
2. Say "the appropriate character in the output" instead of "code point". Although talking about "characters" in relation to Unicode can be ambiguous.

Other options?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/pull/127#discussion_r177303575

Received on Tuesday, 27 March 2018 04:12:20 UTC