Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EncodingService

Hierarchy

  • EncodingService

Index

Methods

decode

  • decode(value: BinaryBuffer, encoding?: undefined | string): string

decodeStream

detectEncoding

Protected detectEncodingByBOMFromBuffer

  • detectEncodingByBOMFromBuffer(buffer: Buffer, bytesRead: number): typeof UTF8_with_bom | typeof UTF16le | typeof UTF16be | undefined

encode

encodeStream

exists

  • exists(encoding: string): boolean

Protected guessEncodingByBuffer

  • guessEncodingByBuffer(buffer: Buffer): Promise<string | undefined>

toIconvEncoding

  • toIconvEncoding(encoding?: undefined | string): string

toResourceEncoding

  • toResourceEncoding(encoding: string, options: { overwriteEncoding?: undefined | false | true; read: (length: number) => Promise<Uint8Array> }): Promise<ResourceEncoding>
  • Parameters

    • encoding: string
    • options: { overwriteEncoding?: undefined | false | true; read: (length: number) => Promise<Uint8Array> }
      • Optional overwriteEncoding?: undefined | false | true
      • read: (length: number) => Promise<Uint8Array>
          • (length: number): Promise<Uint8Array>
          • Parameters

            • length: number

            Returns Promise<Uint8Array>

    Returns Promise<ResourceEncoding>