decodeText
decodeText(
bytes,encoding,options?):string
Defined in: packages/core/src/buffer/text/decode-text.ts:78
Decode bytes as text. Copies, so the result does not alias the input.
Parameters
Section titled “Parameters”Uint8Array
Source bytes.
encoding
Section titled “encoding”Text encoding.
options?
Section titled “options?”See DecodeTextOptions.
Returns
Section titled “Returns”string
The decoded string.
Throws
Section titled “Throws”When options.fatal is true and bytes is not valid
for encoding. Never thrown for "latin1", "ascii" and
"windows-1252", for which every byte is valid.
Throws
Section titled “Throws”For "shift_jis" where the runtime’s TextDecoder
lacks it.
isValidText to test validity without decoding into a string the caller does not need.