Encoding API
Encoding API 提供了一种机制来处理各种字符编码文本,包括传统的非 UTF-8 编码。
API 提供了四个接口:TextDecoder、TextEncoder、TextDecoderStream 和 TextEncoderStream。
备注: 此特性在 Web Worker 中可用。
接口
规范
| Specification |
|---|
| Encoding |
浏览器兼容性
api.TextDecoder
api.TextEncoder
api.TextEncoderStream
api.TextDecoderStream
参见
- 一个 shim,允许在不支持的浏览器中使用这个接口。