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, TextEncoderTextDecoderStream and TextEncoderStream.

Note:

This feature is available in Web Workers.

Interfaces

Tutorials & tools

  • A shim allowing to use this interface in browsers that don't support it.
  • StringView – a C-like representation of strings based on typed arrays.

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