The encoding name for this encoder.
This property is provided for compatibility with the WHATWG TextEncoder interface.
Always "mutf-8"
Encodes a JavaScript string into Modified UTF-8 bytes.
This method converts the input string into a Modified UTF-8 byte array.
The string to encode
A new Uint8Array containing the Modified UTF-8 encoded bytes
Encodes a string into Modified UTF-8 bytes within an existing buffer.
This method provides a memory-efficient way to encode strings by writing directly into a pre-allocated buffer instead of creating a new array.
The encoding process stops when either:
The string to encode into Modified UTF-8 bytes
The Uint8Array buffer to write the encoded bytes into
An object indicating how many characters were read and bytes written
The encoder for Modified UTF-8.
This class provides encoding functionality to convert JavaScript strings into Modified UTF-8 byte sequences. The API is designed to be compatible with the WHATWG
TextEncoderinterface while handling the specific requirements of Modified UTF-8.Example
See