This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Hi, I found this small inaccuracy: https://encoding.spec.whatwg.org/#dom-textencoder-encode "The encode(input, options) method, when invoked..." << /options/ not exist for this method, should be just "encode(input)". In algorithm I don't see using /options/ at least once. For the same case, in green box, this text can be delete: "If options's stream is set to true, the method can be invoked multiple times to process a fragmented stream." << this is funcionality of TextDecoder, not TextEncoder. But in the other site encode() should support streaming like decode()? I test this in Firefox an Chrome: <script type = "text/javascript"> alert(new TextEncoder().encode("", 2,2,2,2)); </script> and get the result: - Chrome works fine, ignores additional arguments - Firefox throw "TypeError: Argument 2 of TextEncoder.encode can't be converted to a dictionary". Looks like Firefox take attention to the second argument but why? Its bug?
TextEncoder used to support streaming, but that was made obsolete when we switched from DOMString to USVString. There's no encoding for which you need multiple scalar values to get a byte sequence. Firefox might still have the old binding.
https://github.com/whatwg/encoding/commit/991c5b6f65fbdf815ace714bbc0d862ba2977e08