Interface TextEncoder

    TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.

    MDN Reference

    interface TextEncoder {
        encoding: string;
        encode(input?: string): Uint8Array;
        encodeInto(
            source: string,
            destination: Uint8Array,
        ): TextEncoderEncodeIntoResult;
    }
    Hierarchy

    Properties

    Methods

    Properties

    encoding: string

    Returns "utf-8".

    MDN Reference

    Methods