Back to Content

TextDecoder: encoding property

files/en-us/web/api/textdecoder/encoding/index.md

latest3.7 KB
Original Source

{{APIRef("Encoding API")}}{{AvailableInWorkers}}

The TextDecoder.encoding read-only property returns a string containing the name of the character encoding that this decoder will use.

The encoding is set by the label parameter passed to the constructor, and defaults to utf-8.

Value

A lower-cased ASCII string, which can be one of the following values:

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • The {{DOMxRef("TextDecoder")}} interface it belongs to.