Interface

Gjsgjs/domTextDecoder

The TextDecoder interface represents a decoder for a specific text encoding. It takes a stream of bytes as input and emits a stream of code points.

1.69.2

interface TextDecoder {
    encoding: TextDecoderEncoding;
    fatal: boolean;
    ignoreBOM: boolean;
    decode(
        input?: ArrayBuffer | ArrayBufferView<ArrayBufferLike>,
        options?: TextDecodeOptions,
    ): string;
}
Index

Properties

Methods

Properties

encoding: TextDecoderEncoding

A string containing the name of the decoder, that is a string describing the method the TextDecoder will use.

fatal: boolean

A Boolean indicating whether the error mode is fatal.

ignoreBOM: boolean

A Boolean indicating whether the byte order mark is ignored.

Methods

  • Returns a string containing the text decoded with the method of the specific TextDecoder object.

    If the error mode is "fatal" and the encoder method encounter an error it WILL THROW a TypeError.

    Parameters

    • Optionalinput: ArrayBuffer | ArrayBufferView<ArrayBufferLike>

      Buffer containing the text to decode

    • Optionaloptions: TextDecodeOptions

      Object defining the decode options

    Returns string