UNPKG

detect-file-encoding-and-language

Version:

Charset Detector - Detect the encoding and language of text files - Use it in the browser, with Node.js, or via CLI

10 lines (7 loc) 234 B
const byteOrderMarks = require("../config/byteOrderMarkObject.js"); module.exports = (uInt8Start) => { for (const element of byteOrderMarks) { if (element.regex.test(uInt8Start)) return element.encoding; } return null; };