Comparing version 1.4.2 to 1.5.0
{ | ||
"name": "jschardet", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "Character encoding auto-detection in JavaScript (port of python's chardet)", | ||
@@ -5,0 +5,0 @@ "main": "src/init", |
@@ -36,2 +36,4 @@ /* | ||
var SURE_NO = 0.01; | ||
var MINIMUM_DATA_THRESHOLD = 3; | ||
var self = this; | ||
@@ -81,3 +83,3 @@ | ||
// if we didn't receive any character in our consideration range, return negative answer | ||
if( this._mTotalChars <= 0 ) { | ||
if( this._mTotalChars <= 0 || this._mFreqChars <= MINIMUM_DATA_THRESHOLD) { | ||
return SURE_NO; | ||
@@ -237,4 +239,4 @@ } | ||
// for sjis encoding, we are interested | ||
// first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe | ||
// second byte range: 0x40 -- 0x7e, 0x81 -- 0xfe | ||
// first byte range: 0x81 -- 0x9f , 0xe0 -- 0xef | ||
// second byte range: 0x40 -- 0x7e, 0x80 -- 0xfc | ||
// no validation needed here. State machine has done that | ||
@@ -249,3 +251,3 @@ if( aStr.charCodeAt(0) >= 0x81 && aStr.charCodeAt(0) <= 0x9F ) { | ||
order += aStr.charCodeAt(1) - 0x40; | ||
if( aStr.charCodeAt(1) > 0x7F ) { | ||
if( aStr.charCodeAt(1) < 0x40 || aStr.charCodeAt(1) === 0x7F || aStr.charCodeAt(1) > 0xFC) { | ||
order = -1; | ||
@@ -252,0 +254,0 @@ } |
@@ -346,4 +346,4 @@ /* | ||
3,3,3,3,3,4,4,4, // e8 - ef | ||
4,4,4,4,4,4,4,4, // f0 - f7 | ||
4,4,4,4,4,0,0,0 // f8 - ff | ||
3,3,3,3,3,3,3,3, // f0 - f7 | ||
3,3,3,3,3,0,0,0 // f8 - ff | ||
]; | ||
@@ -350,0 +350,0 @@ |
@@ -145,2 +145,6 @@ /* | ||
equals( jschardet.detect(str).encoding, "windows-1252" ); | ||
// <string>Martin Kühl</string> | ||
var str = "\x3c\x73\x74\x72\x69\x6e\x67\x3e\x4d\x61\x72\x74\x69\x6e\x20\x4b\xfc\x68\x6c\x3c\x2f\x73\x74\x72\x69\x6e\x67\x3e"; | ||
equals( jschardet.detect(str).encoding, "windows-1252" ); | ||
}); | ||
@@ -231,2 +235,2 @@ | ||
equals( jschardet.detect(str).encoding, "HZ-GB-2312" ); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
1370138
48
17468
4
5