Guess encoding
Guess encoding in an super fast speed!
Install
npm install guess-encoding
Example
var guess = // first argument is the file you want to guess// and the callback function will pass the result of the guessing and second argument is the buffer :)var guess = ; { console // result: // { language: '', charset: 'UTF-8', confidence: 80 } // { language: 'es', charset: 'ISO-8859-1', confidence: 30 }} // start guessingguess;
How it work
Streaming the first chunk of data in memory and only detect for the first few buffer and detected the encoding. So this will work in super large files, cause we are not loading all the data from origin, only a few buffers :)
License
MIT