From 45564fbfbe601ae691e90197143e83a27a35c768 Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Mon, 30 Nov 2015 08:51:34 +1100 Subject: [PATCH] v0.1.0 --- .gitignore | 3 ++- encoding/unicode.js | 10 ++++------ package.json | 7 +++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index f36f48c..4489065 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ testing.js -.DS_Store \ No newline at end of file +.DS_Store +node_modules diff --git a/encoding/unicode.js b/encoding/unicode.js index ddd4032..6458d79 100644 --- a/encoding/unicode.js +++ b/encoding/unicode.js @@ -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; @@ -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 diff --git a/package.json b/package.json index 3a83558..8cf6537 100644 --- a/package.json +++ b/package.json @@ -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": [ @@ -12,6 +12,9 @@ "icu" ], "author": "Dmitry Shirokov ", + "contributors": [ + "@spikying" + ], "devDependencies": { "mocha": ">= 1.8" }, @@ -35,5 +38,5 @@ "directories": { "test": "test" }, - "license" : "MIT" + "license": "MIT" }