buffer.isUtf8(input)


如果 input 只包含有效的 UTF-8 编码数据(包括 input 为空的情况),此函数将返回 true

【This function returns true if input contains only valid UTF-8-encoded data, including the case in which input is empty.】

如果 input 是已分离的数组缓冲区,则会抛出异常。

【Throws if the input is a detached array buffer.】