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.