Encoding API

Note: This feature is available in Web Workers.

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.

Interfaces

Specifications

Specification
Encoding
# interface-textdecoder
Encoding
# interface-textencoder
Encoding
# interface-textencoderstream
Encoding
# interface-textdecoderstream

Browser compatibility

api.TextDecoder

api.TextEncoder

api.TextEncoderStream

api.TextDecoderStream

See also

  • Encoding API Encodings - Encodings that must be supported for decoding text.
  • A polyfill allowing to use this interface in browsers that don't support it