TextEncoder
The TextEncoder
interface enables you to character encoding a JavaScript string using UTF-8.
Functions
Link copied to clipboard
The TextEncoder.encode()
method takes a string as input, and returns a Global_Objects/Uint8Array containing the string character encoding using UTF-8.
Link copied to clipboard
fun encodeInto(source: String, destination: Uint8Array<ArrayBufferLike>): TextEncoderEncodeIntoResult
The TextEncoder.encodeInto()
method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding.