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

annevk 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.

I guess I'd just say "is UTF-8", but for a note it seems fine. Although having said that, it's a little weird that it both talks about code points in the output and says the output is UTF-8 (which is bytes).

-- 
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_r177037119

Received on Monday, 26 March 2018 10:00:20 UTC