Skip to content

Interface: TextDecoder ​

Defined in: types/desktop-engine.d.ts:5864

Decodes bytes: UTF-8, UTF-16LE / BE and the legacy encodings of the Encoding Standard (windows-1252, GBK, gb18030, Big5, Shift_JIS, EUC-JP, EUC-KR, ISO-8859-x, KOI8, ...). The legacy multi-byte ones are decoded by the system: a few characters and how bad bytes are replaced may differ a little from browsers

Properties ​

encoding ​

ts
readonly encoding: string;

Defined in: types/desktop-engine.d.ts:5866

Lowercased name of the encoding, e.g. "utf-8", "gbk"


fatal ​

ts
readonly fatal: boolean;

Defined in: types/desktop-engine.d.ts:5867


ignoreBOM ​

ts
readonly ignoreBOM: boolean;

Defined in: types/desktop-engine.d.ts:5868

Methods ​

decode() ​

ts
decode(input?, options?): string;

Defined in: types/desktop-engine.d.ts:5870

stream: true keeps an incomplete character at the end for the next call

Parameters ​

ParameterType
input?ArrayBuffer | ArrayBufferView<ArrayBufferLike>
options?{ stream?: boolean; }
options.stream?boolean

Returns ​

string

The SDK is released under the Apache License 2.0