TextEncoder()
TextEncoder() 构造函数总是返回一个新创建的 TextEncoder 对象,该对象将生成具有 UTF-8 编码的字节流。
语法
js
new TextEncoder();
参数
无。
规范
| Specification |
|---|
| Encoding Standard # ref-for-dom-textencoder① |
浏览器兼容性
BCD tables only load in the browser
参见
- 属于
TextEncoder接口。
TextEncoder() 构造函数总是返回一个新创建的 TextEncoder 对象,该对象将生成具有 UTF-8 编码的字节流。
js
new TextEncoder();
无。
| Specification |
|---|
| Encoding Standard # ref-for-dom-textencoder① |
BCD tables only load in the browser
TextEncoder 接口。