textDecoder.decode([input[, options]])


解码 input 并返回一个字符串。如果 options.streamtrue,则任何出现在 input 末尾的不完整字节序列都会在内部缓存,并在下一次调用 textDecoder.decode() 后输出。

🌐 Decodes the input and returns a string. If options.stream is true, any incomplete byte sequences occurring at the end of the input are buffered internally and emitted after the next call to textDecoder.decode().

如果 textDecoder.fataltrue,发生的解码错误将会抛出 TypeError

🌐 If textDecoder.fatal is true, decoding errors that occur will result in a TypeError being thrown.