Comparing version 1.0.0 to 1.1.0
@@ -10,3 +10,3 @@ require('text-encoding-polyfill'); | ||
var regex = /^(?:ASNI\s)?(\d+)$/m; | ||
function createDecoder(encoding) { | ||
function createDecoder(encoding, second) { | ||
if (!encoding) { | ||
@@ -19,4 +19,6 @@ return defaultDecoder; | ||
var match = regex.exec(encoding); | ||
if (match) { | ||
encoding = 'windows-' + match[1]; | ||
if (match && !second) { | ||
return createDecoder('windows-' + match[1], true); | ||
} else { | ||
return defaultDecoder; | ||
} | ||
@@ -23,0 +25,0 @@ } |
{ | ||
"name": "parsedbf", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "The DBF parsing component of shapefile-js", | ||
@@ -25,3 +25,3 @@ "main": "index.js", | ||
"jshint": "^2.8.0", | ||
"mocha": "^2.3.3" | ||
"mocha": "^8.1.3" | ||
}, | ||
@@ -28,0 +28,0 @@ "browser": { |
@@ -65,2 +65,13 @@ var fs = require('fs'); | ||
}); | ||
it('should handle utf charicters and a stupid formatting',function(done){ | ||
fs.readFile('./test/data/utf.dbf',function(err,data){ | ||
if(err){ | ||
return done(err); | ||
} | ||
fs.readFile('./test/data/page.html', 'utf8',function(err,data2){ | ||
dbf(data, data2).should.deep.equal(utf); | ||
done(); | ||
}) | ||
}); | ||
}); | ||
it('should handle other charicters',function(done){ | ||
@@ -67,0 +78,0 @@ fs.readFile('./test/data/codepage.dbf',function(err,data){ |
37909
712