Open this example in the interactive library
Source code
import { Buffer, isUtf8, isAscii } from "node:buffer";
console.log(isAscii(Buffer.from("café")));
Sample output
false

Open this example in the interactive library
import { Buffer, isUtf8, isAscii } from "node:buffer";
console.log(isAscii(Buffer.from("café")));
false