Open SamDecrock opened 10 years ago
in /lib/parser
Parser.prototype.parseField = function(field, buffer) {
var value;
if ((field.type === 'C')&&(this.encodingFunction)) {
value = (this.encodingFunction(buffer)).trim();
} else {
value = (buffer.toString(this.encoding)).trim();
}
if (field.type === 'N') {
value = parseInt(value, 10);
} else if (field.type === 'F') {
value = value === +value && value === (value | 0) ? parseInt(value, 10) : parseFloat(value, 10);
}
return value;
};
in project
var iconv = require('iconv-lite');
....
parser.encodingFunction = function (buffer) {
return iconv.decode(new Buffer(buffer), 'CP866'); //CP1252....
};
according to what I read on the internet, DBF doesn't use UTF-8 encoding (for characters like è, é, ü, and so on...), but the Windows CP1252 encoding.
Could you fix that so it supports CP1252 decoding?
Thx!