Answer the question
In order to leave comments, you need to log in
How to handle win-1251 in http.get response?
There is some API, which is given in 1251 encoding. http.get in req.on('data', ...) returns buffer, buffer node does not support 1251 encoding, what should I do?
Answer the question
In order to leave comments, you need to log in
var iconv = new Iconv('windows-1251', 'UTF-8');
http.get(url, function (res) {
res.on('data', function (buffer) {
var html = iconv.convert(buffer).toString();
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question