Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StringEncoding

Responsible for en/decoding strings.

Hierarchy

  • StringEncoding

Index

Properties

Static customDecoder

customDecoder: (bytes: Uint8Array, encodingName: string) => string

Allows the user to set a custom decoding function so more encoding formats the native ones can be supported.

Type declaration

    • (bytes: Uint8Array, encodingName: string): string
    • Parameters

      • bytes: Uint8Array
      • encodingName: string

      Returns string

Static customEncoder

customEncoder: (s: string, encodingName: string) => Uint8Array

Allows the user to set a custom encoding function so more encoding formats the native ones can be supported.

Type declaration

    • (s: string, encodingName: string): Uint8Array
    • Parameters

      • s: string
      • encodingName: string

      Returns Uint8Array

Methods

Static decode

Static Private decodeFallback

  • decodeFallback(bytes: Uint8Array, encoding: string | CharacterSetECI): string

Static encode

Static Private encodeFallback

  • encodeFallback(s: string): Uint8Array

Static encodingCharacterSet

Static encodingName

Static Private isBrowser

  • isBrowser(): boolean

Static Private isDecodeFallbackSupported

Static Private shouldDecodeOnFallback

  • shouldDecodeOnFallback(encodingName: string): boolean
  • Checks if the decoding method should use the fallback for decoding once Node TextDecoder doesn't support all encoding formats.

    Parameters

    • encodingName: string

    Returns boolean

Generated using TypeDoc