guess-api-charset
Guessing api charset.
Example
var guessapi = ;var fs = var guessapi = ; { // result: // { charset: 'utf-8' } <Buffer 66 69 65 6c 64 31 2c 66 69 65 6c 64 32 2c 66 69 65 6c 64 33 0a 31 2c 32 2c 33> // if it can find charset in header it will return charset by http reponse's header charset value. console} guessapi;
How it work?
Only read the first chunk (why read only the first chunk? cause will reduce lot of time of guessing super large data), and guess the encoding by using the first chunk.
License
MIT