From 8dfd0bb687e60da1e43fdf53dbfc7ad54c213363 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 15 Oct 2020 08:40:20 +0200 Subject: [PATCH] Charset logging --- app/src/main/java/eu/faircode/email/CharsetHelper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/CharsetHelper.java b/app/src/main/java/eu/faircode/email/CharsetHelper.java index 938a346161..2989353601 100644 --- a/app/src/main/java/eu/faircode/email/CharsetHelper.java +++ b/app/src/main/java/eu/faircode/email/CharsetHelper.java @@ -24,7 +24,7 @@ import java.nio.charset.StandardCharsets; import java.nio.charset.UnsupportedCharsetException; class CharsetHelper { - private static final int MAX_DETECT_SIZE = 8192; + private static final int MAX_SAMPLE_SIZE = 8192; static { System.loadLibrary("compact_enc_det"); @@ -129,16 +129,16 @@ class CharsetHelper { byte[] octets = text.getBytes(StandardCharsets.ISO_8859_1); byte[] sample; - if (octets.length < MAX_DETECT_SIZE) + if (octets.length < MAX_SAMPLE_SIZE) sample = octets; else { - sample = new byte[MAX_DETECT_SIZE]; - System.arraycopy(octets, 0, sample, 0, MAX_DETECT_SIZE); + sample = new byte[MAX_SAMPLE_SIZE]; + System.arraycopy(octets, 0, sample, 0, MAX_SAMPLE_SIZE); } Log.i("compact_enc_det sample=" + sample.length); String detected = jni_detect(sample); - Log.i("compact_enc_det result=" + detected); + Log.e("compact_enc_det result=" + detected); return Charset.forName(detected); } catch (Throwable ex) {