TextEncoder()

TextEncoder() 构造函数总是返回一个新创建的 TextEncoder 对象,该对象将生成具有 UTF-8 编码的字节流。

语法

js

new TextEncoder();

参数

无。

规范

Specification
Encoding Standard
# ref-for-dom-textencoder①

浏览器兼容性

BCD tables only load in the browser

参见