TextEncoderStream: encoding プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

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

utf-8 のエンコードされたデータが入った文字列です。

以下の例は、TextEncoderStream オブジェクトが encoding を返す方法を示しています。

js
stream = new TextEncoderStream();
console.log(stream.encoding);

仕様書

Specification
Encoding
# dom-textencoder-encoding

ブラウザーの互換性