The text content to decode as a Uint8Array
.
A thenable that resolves to the decoded string
.
Decodes the content from a Uint8Array
to a string
using the
provided encoding. 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.
Note that if you decode content that is unsupported by the encoding, the result may contain substitution characters as appropriate.
The text content to decode as a Uint8Array
.
Additional context for picking the encoding.
Readonly
encoding: stringAllows to explicitly pick the encoding to use. See TextDocument.encoding for more information about valid values for encoding. Using an unsupported encoding will fallback to the default configured encoding.
A thenable that resolves to the decoded string
.
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.
The encoding is picked 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.
A thenable that resolves to the decoded string
.
Decodes the content from a
Uint8Array
to astring
. 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.