Text encoding and decoding will support streams to enable you to easily convert streams of binary data to text and vice-versa. An example of its usefulness is with readable streams. With a non-stream Response object, response.Body.text() returns text. There is no equivalent for the ReadableStream returned by Response.Body, which can only return bytes. With the new API a streaming response body may be converted to text as so: Response.Body.pipeThrough(new TextDecoderStream()).
Documentation
Specification
Status in Chromium
Enabled by default (tracking bug) in:
- Chrome for desktop release 71
- Chrome for Android release 71
- Android WebView release 71
Consensus & Standardization
After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.
Owners
Search tags
TextEncoder, TextDecoder, TransformStream, ReadableStream, WritableStream, transform streams,Last updated on 2020-11-09