[whatwg/encoding] TextDecoderStream: empty Uint8Array should result in an empty string (Issue #283)

Currently the [specification states](https://encoding.spec.whatwg.org/#decode-and-enqueue-a-chunk

):
> If outputChunk is non-empty, then enqueue outputChunk in decoder’s transform.

Lets say I have a Uint8Array based transform stream that splits by line, and we have an empty line (which means the transformstream will queue an empty Uint8Array), TextDecoderStream will make that empty line disappear into thin air, which is not great.

This argument also goes for TextEncoderStream discarding an empty Uint8Array.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/283

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/encoding/issues/283@github.com>

Received on Tuesday, 1 March 2022 23:27:39 UTC