@kayahr/text-encoding

    Class TextEncoder

    The TextEncoder represents an encoder for a specific text encoding, such as UTF-8, ISO-8859-2, KOI8-R, GBK, etc. An encoder takes a string and emits an array of encoded bytes.

    Implements

    • TextEncoder
    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Creates a new encoder for the given encoding.

      Parameters

      • label: string = "utf-8"

        The encoding label. Defaults to UTF-8

      Returns TextEncoder

    Accessors

    • get encoding(): string

      Returns string

      The name of the encoding.

    Methods

    • Encodes the given string and returns the encoded bytes.

      Parameters

      • input: string = ""

        The string to encode.

      Returns Uint8Array

      The encoded bytes.

    • Parameters

      • source: string
      • destination: Uint8Array

      Returns TextEncoderEncodeIntoResult

    MMNEPVFCICPMFPCPTTAAATR