Open this example in the interactive library
Source code
import { Buffer, isUtf8, isAscii } from "node:buffer";
console.log(isUtf8(Buffer.from([0xc3, 0xa9])));
Sample output
true

Open this example in the interactive library
import { Buffer, isUtf8, isAscii } from "node:buffer";
console.log(isUtf8(Buffer.from([0xc3, 0xa9])));
true