Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CodePoint

The class for containing the UTF-16 character and corresponding UTF-8 codepoints array of input string

Hierarchy

  • CodePoint

Constructors

Properties

Methods

Constructors

constructor

  • Create a new CodePoint instance

    Parameters

    • char: string

      A character of the input string

    Returns CodePoint

Properties

Private Readonly utf16_char

utf16_char: string

A character of the input string

Private Readonly utf8_code

utf8_code: number[]

The UTF-8 codepoints array corresponding to the UTF-16 character

Methods

getChar

  • getChar(): string
  • Return the UTF-16 character

    Returns string

getCode

  • getCode(): number[]
  • Return the UTF-8 codepoints array

    Returns number[]

Static toUTF8Array

  • toUTF8Array(str: string): number[]
  • Convert the given <str> to a UTF-8 codepoints array.
    Source code HERE

    Parameters

    • str: string

      The input string

    Returns number[]

Generated using TypeDoc