Converts an ArrayBuffer or ArrayBufferView to a string. The function works like TextDecoder.decode and also supports environments without TextDecoder.
TextDecoder.decode
TextDecoder
The data to decode.
The options for the decoding.
The string representation of the ArrayBuffer.
const str = 'hello world'const utf8 = new Uint8Array(strToCodes(str))equal(decodeText(utf8.buffer, { encoding: UTF_8 }), str) Copy
const str = 'hello world'const utf8 = new Uint8Array(strToCodes(str))equal(decodeText(utf8.buffer, { encoding: UTF_8 }), str)
Converts an ArrayBuffer or ArrayBufferView to a string. The function works like
TextDecoder.decodeand also supports environments withoutTextDecoder.