TextDecoderStream: encoding 屬性
注意:此功能在 Web Workers 中可用。
TextDecoderStream 介面的 encoding 只讀屬性返回一個字串,其中包含特定解碼器使用的編碼演算法的名稱。
編碼由 建構函式的 label 引數設定,預設為 utf-8。
值
包含編碼格式的小寫 ASCII 名稱的字串。
允許的值與 TextDecoder.encoding 中列出的值相同(編碼 API 編碼中的標籤)。
示例
從 TextDecoderStream 返回 encoding 的值。
js
stream = new TextDecoderStream();
console.log(stream.encoding); // returns the default "utf-8"
規範
| 規範 |
|---|
| 編碼 # dom-textdecoder-encoding |
瀏覽器相容性
載入中…