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
# ref-for-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
Partial support
Partial support
Has more compatibility info.

参见