Created
January 13, 2017 03:28
-
-
Save breezewish/c81caa227287a302fd44ff5621fa5bb8 to your computer and use it in GitHub Desktop.
Detect Charset and Convert to UTF-8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Iconv = require('iconv').Iconv; | |
var jschardet = require('jschardet'); | |
return new Iconv(jschardet.detect(buf).encoding, 'UTF-8//TRANSLIT//IGNORE').convert(buf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment