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
Encoding
# interface-textdecoder
Encoding
# interface-textencoder

Browser compatibility

api.TextDecoder

BCD tables only load in the browser

api.TextEncoder

BCD tables only load in the browser

See also

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