happypdf / utf16Decode
Function: utf16Decode()
ts
function utf16Decode(input, byteOrderMark?): string;Defined in: src/utils/unicode.ts:283
Decodes a Uint8Array of data to a string using UTF-16.
Note that this function attempts to recover from erronous input by inserting the replacement character (�) to mark invalid code points and surrogate pairs.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
input | Uint8Array | undefined | A Uint8Array containing UTF-16 encoded data |
byteOrderMark | boolean | true | Whether or not a byte order marker (BOM) should be read at the start of the encoding. (default true) |
Returns
string
The decoded string.