This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/main by this push:
new 55f5273e1 Fix an issue in Text Detector (#615)
55f5273e1 is described below
commit 55f5273e107bc295de2060c8c4a69bbce234c729
Author: thebsssss <[email protected]>
AuthorDate: Tue Jul 26 01:44:34 2022 +0800
Fix an issue in Text Detector (#615)
According to what characters is encoded in UTF8, we should count the number
of bytes from 0xf8 to 0x100 instead of 0xf80 to 0x100 which is apparently a
typo.
---
tika-core/src/main/java/org/apache/tika/detect/TextStatistics.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tika-core/src/main/java/org/apache/tika/detect/TextStatistics.java
b/tika-core/src/main/java/org/apache/tika/detect/TextStatistics.java
index d536420b8..50f8d790a 100644
--- a/tika-core/src/main/java/org/apache/tika/detect/TextStatistics.java
+++ b/tika-core/src/main/java/org/apache/tika/detect/TextStatistics.java
@@ -71,7 +71,7 @@ public class TextStatistics {
int continuation = count(0x80, 0xc0);
return utf8 > 0 && continuation <= expectedContinuation &&
- continuation >= expectedContinuation - 3 && count(0xf80,
0x100) == 0 &&
+ continuation >= expectedContinuation - 3 && count(0xf8, 0x100)
== 0 &&
(control - safe) * 100 < utf8 * 2;
}