TextDecoderStream.encoding

The encoding read-only property of the TextDecoderStream interface returns a DOMString containing the name of the encoding algorithm used by the specific encoder.

Syntax

var encoding = TextDecoderStream.encoding;

Value

A DOMString, ASCII lowercased.

Examples

Returning the value of encoding from a TextDecoderStream.

stream = new TextDecoderStream();
console.log(stream.encoding); // returns the default "utf-8"

Specifications

Specification Status Comment
Encoding
The definition of 'TextDecoderStream.encoding' in that specification.
Living Standard Initial definition.

Browser compatibility

BCD tables only load in the browser