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.

Copyright

Apache License 2.0

Author

Sam Thorogood

See

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

Hierarchy

  • TextDecoder

Implements

Constructors

Properties

Methods

Constructors

  • Parameters

    • Optional encoding: 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

    • Optional input: BufferSource

      The BufferSource to decode.

    • Optional options: TextDecodeOptions

      The options for decoding.

    Returns string

    The decoded string.

Generated using TypeDoc