Created
February 27, 2018 12:06
-
-
Save kobkrit/b6947131a351c9d91eec900fce04f18e to your computer and use it in GitHub Desktop.
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 conv = new Iconv('windows-874', 'utf8'); | |
var rq = require('request'); | |
rq({ | |
url: someurl | |
encoding: 'binary' | |
}, function (error, resp, body) { | |
body = new Buffer(body, 'binary'); | |
body = conv.convert(body).toString(); | |
//Now body is converted to utf8 | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment