The issue seems to because we are doing Iconv conversion on chunks. Likely there is a byte alignment issues. Following code in verb.js seems to be the problem.
this['parse response'] = function(args) { // Just append bufs to a string
var encoding = 'UTF-8';
if(args.headers['content-type']) {
var contentType = headers.parse('content-type', args.headers['content-type'] || '');
encoding = contentType.params.charset ? contentType.params.charset :
contentType.subtype === 'csv' ? 'ASCII' : 'UTF-8';
}
var str = '';
var iconv = new Iconv(encoding, 'UTF-8');
_.each(args.body, function(buf) {
buf = (iconv.convert(buf));
str += buf.toString('UTF-8');
});
return {
content: str
};
};
The issue seems to because we are doing Iconv conversion on chunks. Likely there is a byte alignment issues. Following code in verb.js seems to be the problem.
this['parse response'] = function(args) { // Just append bufs to a string var encoding = 'UTF-8'; if(args.headers['content-type']) { var contentType = headers.parse('content-type', args.headers['content-type'] || ''); encoding = contentType.params.charset ? contentType.params.charset : contentType.subtype === 'csv' ? 'ASCII' : 'UTF-8'; } var str = ''; var iconv = new Iconv(encoding, 'UTF-8'); _.each(args.body, function(buf) { buf = (iconv.convert(buf)); str += buf.toString('UTF-8'); }); return { content: str }; };