From a43b730ed4b2a1684c2053c34f347ce7fb62c72f Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 22 Mar 2020 12:46:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/utils/EncodingDetect.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/EncodingDetect.java b/app/src/main/java/io/legado/app/utils/EncodingDetect.java index 29174b88e..b5bd4cf66 100644 --- a/app/src/main/java/io/legado/app/utils/EncodingDetect.java +++ b/app/src/main/java/io/legado/app/utils/EncodingDetect.java @@ -66,7 +66,7 @@ public class EncodingDetect { } public static String getEncode(@NonNull byte[] bytes) { - int len = bytes.length > 2000 ? 2000 : bytes.length; + int len = Math.min(bytes.length, 2000); byte[] cBytes = new byte[len]; System.arraycopy(bytes, 0, cBytes, 0, len); BytesEncodingDetect bytesEncodingDetect = new BytesEncodingDetect(); @@ -1010,14 +1010,8 @@ class BytesEncodingDetect extends Encoding { column = rawtext[i + 1] + 256; if (column < 0x9f) { adjust = 1; - if (column > 0x7f) { - column -= 0x20; - } else { - column -= 0x19; - } } else { adjust = 0; - column -= 0x7e; } if (row < 0xa0) { row = ((row - 0x70) << 1) - adjust;