Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

Index

Properties

Methods

Properties

Readonly encoding

encoding: string

Returns "utf-8".

Methods

encode

  • Returns the result of running UTF-8's encoder.

    Parameters

    • Optional input: string

    Returns Uint8Array

encodeInto

  • Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as a dictionary whereby read is the number of converted code units of source and written is the number of bytes modified in destination.

    Parameters

    Returns TextEncoderEncodeIntoResult

Generated using TypeDoc