You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tika-encoding-detectors/tika-encoding-detector-mojibuster/src/main/java/org/apache/tika/ml/chardetect/MojibusterEncodingDetector.java
+13-25Lines changed: 13 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -174,16 +174,10 @@ public class MojibusterEncodingDetector implements EncodingDetector {
Copy file name to clipboardExpand all lines: tika-encoding-detectors/tika-encoding-detector-mojibuster/src/main/java/org/apache/tika/ml/chardetect/StructuralEncodingRules.java
+3-11Lines changed: 3 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -894,17 +894,9 @@ public static int countUtf8Errors(byte[] bytes, int offset, int length) {
894
894
returnerrors;
895
895
}
896
896
897
-
/**
898
-
* Counts complete, valid multi-byte UTF-8 sequences in the sample —
899
-
* companion to {@link #countUtf8Errors}, same walk, opposite tally. Used
900
-
* to gauge how much genuine UTF-8 evidence a probe carries independent of
901
-
* its error count: a probe with one tolerated error and hundreds of valid
902
-
* sequences is overwhelmingly UTF-8; a probe with one tolerated error and
903
-
* two or three valid sequences (a short filename, say) is not distinguishable
904
-
* from a coincidentally-valid legacy-encoded string.
905
-
*
906
-
* @return number of complete, well-formed multi-byte UTF-8 sequences
907
-
*/
897
+
/** Counts complete, valid multi-byte UTF-8 sequences — companion to
898
+
* {@link #countUtf8Errors}, same walk, opposite tally. Gauges how much
899
+
* genuine UTF-8 evidence a probe carries independent of its error count. */
Copy file name to clipboardExpand all lines: tika-encoding-detectors/tika-encoding-detector-mojibuster/src/test/java/org/apache/tika/ml/chardetect/ToleratedUtf8StructuralRegressionTest.java
+13-58Lines changed: 13 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -30,32 +30,13 @@
30
30
importorg.apache.tika.detect.EncodingResult;
31
31
32
32
/**
33
-
* Regression test for a real-world failure: a genuinely UTF-8 HTML page whose
0 commit comments