From 0593c6afcfa0652cce4d2ee82cee8be5a0eba1bb Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 31 Oct 2021 12:40:50 +0100 Subject: [PATCH] Added GB2312 workaround --- .../main/java/eu/faircode/email/UnknownCharsetProvider.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/UnknownCharsetProvider.java b/app/src/main/java/eu/faircode/email/UnknownCharsetProvider.java index 0ca9d4002c..60c54ff6b4 100644 --- a/app/src/main/java/eu/faircode/email/UnknownCharsetProvider.java +++ b/app/src/main/java/eu/faircode/email/UnknownCharsetProvider.java @@ -65,6 +65,10 @@ public class UnknownCharsetProvider extends CharsetProvider { if (name.contains("UTF8") || name.contains("UTF-8")) // //TRANSLIT return StandardCharsets.UTF_8; + // https://charset-normalizer.readthedocs.io/en/latest/support.html + if (name.contains("GB2312")) + name = "GB2312"; + if (TextUtils.isEmpty(name) || name.contains("ASCII") || //name.startsWith("ISO8859") ||