Skip to main content
isUtf8 - node__buffer.d.ts - Node documentation
function isUtf8

Usage in Deno

```typescript import { isUtf8 } from "node:node__buffer.d.ts"; ```
isUtf8(input:
Buffer
| ArrayBuffer
| TypedArray
): boolean
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.

Parameters

input:
Buffer
| ArrayBuffer
| TypedArray
The input to validate.

Return Type

boolean