Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
runk committed Nov 29, 2015
1 parent 9609ab4 commit 45564fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
testing.js
.DS_Store
.DS_Store
node_modules
10 changes: 4 additions & 6 deletions encoding/unicode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ module.exports.UTF_16BE = function() {
var input = det.fRawInput;

if (input.length >= 2 && ((input[0] & 0xff) == 0xfe && (input[1] & 0xff) == 0xff)) {
var confidence = 100;
return new Match(det, this, confidence);
}
return new Match(det, this, 100); // confidence = 100
}

// TODO: Do some statistics to check for unsigned UTF-16BE
return null;
Expand All @@ -31,13 +30,12 @@ module.exports.UTF_16LE = function() {
var input = det.fRawInput;

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) {
// It is probably UTF-32 LE, not UTF-16
return null;
}
var confidence = 100;
return new Match(det, this, confidence);
return new Match(det, this, 100); // confidence = 100
}

// TODO: Do some statistics to check for unsigned UTF-16LE
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chardet",
"version": "0.0.8",
"version": "0.1.0",
"homepage": "https://github.com/runk/node-chardet",
"description": "Character detector",
"keywords": [
Expand All @@ -12,6 +12,9 @@
"icu"
],
"author": "Dmitry Shirokov <[email protected]>",
"contributors": [
"@spikying"
],
"devDependencies": {
"mocha": ">= 1.8"
},
Expand All @@ -35,5 +38,5 @@
"directories": {
"test": "test"
},
"license" : "MIT"
"license": "MIT"
}

0 comments on commit 45564fb

Please sign in to comment.