TextEncoder extension type

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


API documentation sourced from MDN Web Docs.

on
Implemented types
Available extensions

Constructors

TextEncoder()
factory

Properties

encoding String
The TextEncoder.encoding read-only property returns a string containing the name of the encoding algorithm used by the specific encoder.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

encode([String input]) JSUint8Array
The TextEncoder.encode() method takes a string as input, and returns a Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
encodeInto(String source, JSUint8Array destination) TextEncoderEncodeIntoResult
The TextEncoder.encodeInto() method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding. This is potentially more performant than the older encode() method — especially when the target buffer is a view into a Wasm heap.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited