Returns a newly constructed TextEncoder that will generate a byte stream with UTF-8 encoding.
Readonly
encodingThe TextEncoder.encoding read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. It is always set to the value "utf-8".
UTF-8 encodes the input
string and returns a Uint8Array
containing the encoded bytes.
Optional
input: stringGenerated using TypeDoc
An implementation of the WHATWG Encoding Standard
TextEncoder
API. All instances ofTextEncoder
only support UTF-8 encoding.TextEncoder takes a stream of code points as input and emits a stream of UTF-8 bytes.
See
TextEncoder on MDN
Example