Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "jschardet", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Character encoding auto-detection in JavaScript (port of python's chardet)", | ||
@@ -10,3 +10,3 @@ "main": "src/init", | ||
"type": "git", | ||
"url": "https://brainafk@github.com/brainafk/jschardet.git" | ||
"url": "https://brainafk@github.com/brainafk/node-jschardet.git" | ||
}, | ||
@@ -13,0 +13,0 @@ "directories": { "lib": "./lib", "test": "./test" }, |
@@ -68,9 +68,12 @@ /* | ||
jschardet.VERSION = "0.1"; | ||
jschardet.detect = function(aBuf) { | ||
jschardet.detect = function(buffer) { | ||
var u = new jschardet.UniversalDetector(); | ||
u.reset(); | ||
if( aBuf instanceof Array ) { | ||
u.feed(String.fromCharCode.apply(String, aBuf)); | ||
if( buffer instanceof Buffer ) { | ||
var str = ""; | ||
for (var i = 0; i < buffer.length; ++i) | ||
str += String.fromCharCode(buffer[i]) | ||
u.feed(str); | ||
} else { | ||
u.feed(aBuf); | ||
u.feed(buffer); | ||
} | ||
@@ -77,0 +80,0 @@ u.close(); |
@@ -152,3 +152,3 @@ /* | ||
if( jschardet.Constants._debug ) { | ||
log("no data received!\n"); | ||
console.log("no data received!\n"); | ||
} | ||
@@ -160,2 +160,3 @@ return; | ||
if( this._mInputState == _state.pureAscii ) { | ||
console.log("pure ascii") | ||
this.result = {"encoding": "ascii", "confidence": 1.0}; | ||
@@ -188,6 +189,6 @@ return this.result; | ||
if( jschardet.Constants._debug ) { | ||
log("no probers hit minimum threshhold\n"); | ||
console.log("no probers hit minimum threshhold\n"); | ||
for( var i = 0, prober; prober = this._mCharsetProbers[i]; i++ ) { | ||
if( !prober ) continue; | ||
log(prober.getCharsetName() + " confidence = " + | ||
console.log(prober.getCharsetName() + " confidence = " + | ||
prober.getConfidence() + "\n"); | ||
@@ -194,0 +195,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
531121
8611