Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @stablelib/utf8

Index

Functions

  • decode(arr: Uint8Array): string
  • Decodes the given byte array from UTF-8 into a string. Throws if encoding is invalid.

    Parameters

    • arr: Uint8Array

    Returns string

  • encode(s: string): Uint8Array
  • Encodes the given string into UTF-8 byte array. Throws if the source string has invalid UTF-16 encoding.

    Parameters

    • s: string

    Returns Uint8Array

  • encodedLength(s: string): number
  • Returns the number of bytes required to encode the given string into UTF-8. Throws if the source string has invalid UTF-16 encoding.

    Parameters

    • s: string

    Returns number

Generated using TypeDoc