
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
detect-character-encoding
Advanced tools
Detect character encoding using ICU
Tip: If you don’t need ICU in particular, consider using ced, which is based on Google’s lighter compact_enc_det library.
$ npm install detect-character-encoding
detect-character-encoding is a C++ addon. Therefore, you may need to install various build tools. Check node-gyp’s readme for more information.
const fs = require('fs');
const detectCharacterEncoding = require('detect-character-encoding');
const fileBuffer = fs.readFileSync('file.txt');
const charsetMatch = detectCharacterEncoding(fileBuffer);
console.log(charsetMatch);
// {
// encoding: 'UTF-8',
// confidence: 60
// }
detect-character-encoding may return null
if no charset matches.
detect-character-encoding does not support 32-bit operating systems.
As listed in ICU’s user guide:
detect-character-encoding is licensed under the BSD 2-clause license but includes third-party software under different licenses. See LICENSE.md
for the full license text.
v0.9.0 (2024-01-06)
FAQs
Detect character encoding using ICU
The npm package detect-character-encoding receives a total of 3,576 weekly downloads. As such, detect-character-encoding popularity was classified as popular.
We found that detect-character-encoding demonstrated a not healthy version release cadence and project activity because the last version was released 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.