isUtf8

external fun isUtf8(input: Buffer): Boolean(source)
external fun isUtf8(input: ArrayBuffer): Boolean(source)
external fun isUtf8(input: TypedArray<*, *, *, *>): Boolean(source)

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

Throws if the input is a detached array buffer.

Since

v19.4.0, v18.14.0

Parameters

input

The input to validate.