v0.1.0
This commit is contained in:
parent
9609ab4a7a
commit
45564fbfbe
|
@ -1,2 +1,3 @@
|
||||||
testing.js
|
testing.js
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
|
|
@ -14,9 +14,8 @@ module.exports.UTF_16BE = function() {
|
||||||
var input = det.fRawInput;
|
var input = det.fRawInput;
|
||||||
|
|
||||||
if (input.length >= 2 && ((input[0] & 0xff) == 0xfe && (input[1] & 0xff) == 0xff)) {
|
if (input.length >= 2 && ((input[0] & 0xff) == 0xfe && (input[1] & 0xff) == 0xff)) {
|
||||||
var confidence = 100;
|
return new Match(det, this, 100); // confidence = 100
|
||||||
return new Match(det, this, confidence);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Do some statistics to check for unsigned UTF-16BE
|
// TODO: Do some statistics to check for unsigned UTF-16BE
|
||||||
return null;
|
return null;
|
||||||
|
@ -31,13 +30,12 @@ module.exports.UTF_16LE = function() {
|
||||||
var input = det.fRawInput;
|
var input = det.fRawInput;
|
||||||
|
|
||||||
if (input.length >= 2 && ((input[0] & 0xff) == 0xff && (input[1] & 0xff) == 0xfe)) {
|
if (input.length >= 2 && ((input[0] & 0xff) == 0xff && (input[1] & 0xff) == 0xfe)) {
|
||||||
// An LE BOM is present.
|
// LE BOM is present.
|
||||||
if (input.length >= 4 && input[2] == 0x00 && input[3] == 0x00) {
|
if (input.length >= 4 && input[2] == 0x00 && input[3] == 0x00) {
|
||||||
// It is probably UTF-32 LE, not UTF-16
|
// It is probably UTF-32 LE, not UTF-16
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var confidence = 100;
|
return new Match(det, this, 100); // confidence = 100
|
||||||
return new Match(det, this, confidence);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Do some statistics to check for unsigned UTF-16LE
|
// TODO: Do some statistics to check for unsigned UTF-16LE
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "chardet",
|
"name": "chardet",
|
||||||
"version": "0.0.8",
|
"version": "0.1.0",
|
||||||
"homepage": "https://github.com/runk/node-chardet",
|
"homepage": "https://github.com/runk/node-chardet",
|
||||||
"description": "Character detector",
|
"description": "Character detector",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -12,6 +12,9 @@
|
||||||
"icu"
|
"icu"
|
||||||
],
|
],
|
||||||
"author": "Dmitry Shirokov <deadrunk@gmail.com>",
|
"author": "Dmitry Shirokov <deadrunk@gmail.com>",
|
||||||
|
"contributors": [
|
||||||
|
"@spikying"
|
||||||
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": ">= 1.8"
|
"mocha": ">= 1.8"
|
||||||
},
|
},
|
||||||
|
@ -35,5 +38,5 @@
|
||||||
"directories": {
|
"directories": {
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
"license" : "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue