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 January 2020.

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

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

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

规范

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

浏览器兼容性

BCD tables only load in the browser

参见