TextDecoderStream: encoding プロパティ

encodingTextDecoderStream インターフェイスの読み取り専用プロパティで、このデコーダーが使用するエンコーディングアルゴリズムの名前が入った文字列を返します。

エンコーダーは コンストラクターlabel 引数で設定し、既定値は utf-8 となります。

文字列で、エンコーディング形式の名前を表す小文字の ASCII 名が入ります。

取りうる値は TextDecoder.encoding に挙げられているもの(エンコーディング API のエンコーディングにあるラベル)と同じです。

TextDecoderStream から encoding の値を返します。

js
stream = new TextDecoderStream();
console.log(stream.encoding); // 既定値の "utf-8" を返す

仕様書

Specification
Encoding
# dom-textdecoder-encoding

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
encoding

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support