TextEncoder()
constructor returns a newly created utf-8
TextEncoder
对象。
encoder = new TextEncoder();
TextEncoder()
takes no parameters since Firefox 48 and Chrome 53
注意
: Prior to Firefox 48 and Chrome 53, an encoding type label was accepted as a paramer to the
TextEncoder
object, since then both browers have removed support for any encoder type other than
utf-8
, to match the
spec
. Any type label passed into the
TextEncoder
constructor will now be ignored and a
utf-8
TextEncoder
将被创建。
TextEncoder()
throws no exceptions since Firefox 48 and Chrome 53
注意 : Prior to Firefox 48 and Chrome 53 an exception would be thrown for an unknown encoding type.
| 规范 | 状态 | 注释 |
|---|---|---|
|
编码
The definition of 'TextEncoder()' in that specification. |
实时标准 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
TextEncoder()
构造函数
|
Chrome
53
注意事项
|
Edge
79
注意事项
|
Firefox
48
注意事项
|
IE 不支持 No | Opera 25 | Safari 10.1 | WebView Android 38 | Chrome Android 38 |
Firefox Android
48
注意事项
|
Opera Android ? | Safari iOS 10.3 | Samsung Internet Android 3.0 |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
见实现注意事项。
TextEncoder
interface it belongs to.
TextEncoder
TextEncoder()