Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
detect-character-encoding
Advanced tools
Detect character encoding using ICU.
Install using:
$ npm install detect-character-encoding --save
Use it like this:
var fs = require('fs');
var detectCharacterEncoding = require('detect-character-encoding');
var fileBuffer = fs.readFileSync('file.txt');
var charsetMatch = detectCharacterEncoding(fileBuffer);
console.log(charsetMatch);
// {
// encoding: 'UTF-8',
// confidence: 60
// }
detect-character-encoding should work fine on:
You may currently encounter issues on 32-bit systems and Windows.
As listed in ICU’s user guide:
detect-character-encoding is licensed under the BSD 2-clause license, subject to additional terms. See LICENSE for the full license text.
v0.2.0 (2015-09-15)
FAQs
Detect character encoding using ICU
The npm package detect-character-encoding receives a total of 4,169 weekly downloads. As such, detect-character-encoding popularity was classified as popular.
We found that detect-character-encoding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.