Search results

Encoding API in JavaScript (ES5) File Utils API control

Encoding class: Contains the details about encoding type, whether to write a Unicode byte order mark (BOM).

let encoding : Encoding = new Encoding();
encoding.type = 'Utf8';
encoding.getBytes('Encoding', 0, 5);


includeBom boolean

Gets a value indicating whether to write a Unicode byte order mark

type EncodingType

Gets the encoding type.



To clear the encoding instance

Returns void


Calculates the number of bytes produced by encoding the characters in the specified string

Parameter Type Description
chars string The string containing the set of characters to encode

Returns number


Encodes a set of characters from the specified string into the ArrayBuffer.

Returns ArrayBuffer


Decodes a sequence of bytes from the specified ArrayBuffer into the string.

Returns string