TextEncoder

The TextEncoder interface takes a stream of code points as input and emits a stream of UTF-8 bytes.

MDN Reference

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open val encoding: String

Returns "utf-8".

Functions

Link copied to clipboard
fun encode(input: String = definedExternally): Uint8Array<ArrayBuffer>

Returns the result of running UTF-8's encoder.

Link copied to clipboard

Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.