此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

TextDecoder.encoding

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2020年1月⁩.

只读属性 TextDecoder.encoding 返回一个字符串,其中包含了指定的解码器的解码算法的名称。

编码由构造函数label 参数设置,并且默认是 utf-8

小写的 ASCII 字符,可以是以下值之一:

规范

Specification
Encoding
# ref-for-dom-textdecoder-encoding①

浏览器兼容性

参见