decodeAsync
Decodes the content from a Uint8Array
to a string
. You MUST provide the entire content at once to ensure that the encoding can properly apply. Do not use this method to decode content in chunks, as that may lead to incorrect results.
Will pick an encoding based on settings and the content of the buffer (for example byte order marks).
Note that if you decode content that is unsupported by the encoding, the result may contain substitution characters as appropriate.
Parameters
content
The text content to decode as a Uint8Array
.
Throws
This
method will throw an error when the content is binary.