Skip to content

Commit

Permalink
npm run dist
Browse files Browse the repository at this point in the history
  • Loading branch information
aadsm committed Jun 18, 2024
1 parent a3a1f41 commit cf9fb78
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
31 changes: 26 additions & 5 deletions dist/jschardet.js
Original file line number Diff line number Diff line change
Expand Up @@ -7707,14 +7707,35 @@ function UniversalDetector(options) {
return this.result;
}

if( this._mInputState == _state.highbyte ) {
for( var i = 0, prober; prober = this._mCharsetProbers[i]; i++ ) {
if( !prober || !prober.getCharsetName() || !canDetectEncoding(prober.getCharsetName()) ) continue;
if (this._mInputState == _state.highbyte) {
let windows_1252_confidence = 0;
let windows_1250_detected = false;
for (var i = 0, prober; prober = this._mCharsetProbers[i]; i++) {
if (!prober) continue;
const charsetName = prober.getCharsetName();
const confidence = prober.getConfidence();
if (prober.getCharsetName() === "windows-1252") {
windows_1252_confidence = confidence;
}
if (!charsetName || !canDetectEncoding(charsetName)) continue;
this.results.push({
"encoding": prober.getCharsetName(),
"confidence": prober.getConfidence()
"confidence": confidence
});
if (prober.getCharsetName() === "windows-1250") {
windows_1250_detected = true;
}
logger.log(prober.getCharsetName() + " confidence " + confidence);
}
// HACK: When windows-1252 is detected it's almost sure that it can
// also be windows-1250.
// https://en.wikipedia.org/wiki/Windows-1250 (Central European)
if (windows_1252_confidence && !windows_1250_detected && canDetectEncoding("windows-1250")) {
this.results.push({
"encoding": "windows-1250",
// Report the confidence just a bit under windows-1252's.
"confidence": windows_1252_confidence - Math.pow(5/10, (String(windows_1252_confidence).length - 1)),
});
logger.log(prober.getCharsetName() + " confidence " + prober.getConfidence());
}
this.results.sort(function(a, b) {
return b.confidence - a.confidence;
Expand Down
11 changes: 6 additions & 5 deletions dist/jschardet.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf9fb78

Please sign in to comment.