From 9741825fd11c52a03626ccc3b38e44020392bc0d Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 24 Aug 2021 17:44:15 +0200 Subject: [PATCH] Trim word encoding --- app/src/main/java/eu/faircode/email/MessageHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 8dc51fbc40..1cf87a37f4 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -1824,12 +1824,13 @@ public class MessageHelper { } static byte[] decodeWord(String word, String encoding, String charset) throws IOException { + String e = encoding.trim(); ByteArrayInputStream bis = new ByteArrayInputStream(ASCIIUtility.getBytes(word)); InputStream is; - if (encoding.equalsIgnoreCase("B")) + if (e.equalsIgnoreCase("B")) is = new BASE64DecoderStream(bis); - else if (encoding.equalsIgnoreCase("Q")) + else if (e.equalsIgnoreCase("Q")) is = new QDecoderStreamEx(bis); else { Log.e(new UnsupportedEncodingException("Encoding=" + encoding));