TextEncoder extension type
The TextEncoder
interface takes a stream of code points as input and
emits a stream of UTF-8 bytes.
Constructors
- TextEncoder()
-
factory
Properties
Methods
-
encode(
[String input]) → JSUint8Array -
The
TextEncoder.encode()
method takes a string as input, and returns aUint8Array
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 destinationUint8Array
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 olderencode()
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