From fd497698abda1acd11e896d1bec722b6becc607e Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 30 Jan 2020 21:42:37 +0100 Subject: [PATCH] Small improvement --- app/src/main/java/eu/faircode/email/MessageHelper.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 326eb27d80..e90040beb8 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -45,6 +45,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; +import java.nio.charset.IllegalCharsetNameException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; @@ -1259,7 +1260,14 @@ public class MessageHelper { charset = charset.replace("\"", ""); charset = MimeUtility.javaCharset(charset); - if (!Charset.isSupported(charset)) { + boolean supported = false; + try { + supported = Charset.isSupported(charset); + } catch (IllegalCharsetNameException ex) { + Log.e(charset, ex); + } + + if (!supported) { // x-binaryenc // UseInqueCodePage // none