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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
encoding
71
79
No
No
58
14.1
71
71
No
50
14.5
10.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/TextDecoderStream/encoding