Class TextDecoder

The TextDecoder interface represents a decoder for a specific text encoding. The implementation in nx.js only supports "utf-8" decoding.

If you need to decode binary data of a different encoding, consider importing a more full-featured polyfill, such as @kayahr/text-encoding.

Apache License 2.0

Sam Thorogood

https://github.com/samthor/fast-text-encoding/blob/master/src/lowlevel.js

Implements

Constructors

Properties

Methods

Constructors

  • Parameters

    • Optionalencoding: string

    Returns TextDecoder

Properties

encoding: string
fatal: boolean
ignoreBOM: boolean

Methods

  • Decodes a BufferSource into a string using the specified encoding. If no input is provided, an empty string is returned.

    Note: Currently the stream option is not supported.

    Parameters

    • Optionalinput: BufferSource

      The BufferSource to decode.

    • Optionaloptions: TextDecodeOptions

      The options for decoding.

    Returns string

    The decoded string.