- From: Anne van Kesteren <notifications@github.com>
- Date: Thu, 09 Feb 2017 00:22:22 -0800
- To: whatwg/encoding <encoding@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 9 February 2017 08:22:56 UTC
```javascript
const buf = new ArrayBuffer(2),
view = new Uint8Array(buf),
buf2 = new ArrayBuffer(1),
view2 = new Uint8Array(buf2),
decoder = new TextDecoder("utf-8", { ignoreBOM:true })
view[0] = 0xEF;
view[1] = 0xBB;
view2[0] = 0xBF;
assert(decoder.decode(buf, {stream:true}) === "")
assert(decoder.decode(buf2) === "\uFEFF")
```
Now if you put something like `view[0] = 0x00;` between the asserts, that should not change the outcome. The alternative would be to detach the buffer I suppose. We could maybe make that an option. @inexorabletash?
--
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/issues/92#issuecomment-278576165
Received on Thursday, 9 February 2017 08:22:56 UTC