Encoding API
Elide supports the standard JavaScript types TextEncoder
and TextDecoder
. These classes can be used to obtain byte-arrays of strings in different encodings, or to obtain strings from byte arrays with different encodings.
Supported Encodings
Elide supports several encodings via the TextEncoder
and TextDecoder
constructors:
Support | Charset | Encoding (Label) | Notes |
---|---|---|---|
🟢 Supported. |
|
| |
🟢 Supported. |
|
| |
🟢 Supported. |
|
| Default encoding |
🔴 Not supported yet. |
|
| |
🔴 Not supported yet. |
|
| |
🔴 Not supported yet. | (Other charsets) |
Classes
TextEncoder
Encode strings into byte array representations🟢 Supported.
TextDecoder
Decode byte arrays into string representations🟢 Supported.
TextEncoder
The TextEncoder
class behaves very similarly to how it behaves in a browser, or under Node.js; the only difference is that Elide supports additional encodings, on top of the default, which is utf-8
.
TextEncoder
Properties
TextEncoder.encoding
🟢 Supported.
TextEncoder
Methods
TextEncoder.encode
🟢 Supported.
TextEncoder.encodeInto
🟢 Supported.
TextDecoder
The TextDecoder
class behaves identically to how it behaves in a browser, or under Node.js.
TextDecoder
Properties
TextDecoder.encoding
🟢 Supported.
TextDecoder
Methods
TextDecoder.decode
🟢 Supported.