detect-encoding
v0.0.3
Published
Simple binding for ICU charset detector
Downloads
5
Readme
Detect encoding name with ICU
Installation
Install libicu.
In your $PATH icu-config should be available.
npm install detect-encodingUbuntu
apt-get install libicu-devOSX
- Brew
brew install icu4c
export PATH=$PATH:/usr/local/Cellar/icu4c/52.1 #take a look which version you haveUsage
Simple usage
var detectEncoding = require("detect-encoding");
var buffer = fs.readFileSync("/path/to/the/file");
var charset = detectEncoding(buffer, function(err, result) {
console.log(result)
});