Encoding API

The Encoding API provides a mechanism for handling text in various character encodings, including legacy non-UTF-8 encodings.

The API provides four interfaces: TextDecoder, TextEncoder, TextDecoderStream and TextEncoderStream.

Note: This feature is available in Web Workers

Interfaces

Specifications

Specification Status Comment
Encoding Living Standard Initial definition.

Browser compatibility

TextDecoder

BCD tables only load in the browser

TextEncoder

BCD tables only load in the browser

See also

  • A shim allowing to use this interface in browsers that don't support it