From 3b8808e8116be500e8b87d1eca4523238f663da0 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 21 Apr 2022 12:58:26 +0200 Subject: [PATCH] Fixed signed content character set --- app/src/main/java/eu/faircode/email/MessageHelper.java | 4 ++-- 1 file changed, 2 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 db5cbd27ea..d959c697f8 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -3328,7 +3328,7 @@ public class MessageHelper { ByteArrayOutputStream bos = new ByteArrayOutputStream(); apart.part.writeTo(bos); - String raw = new String(bos.toByteArray()); + String raw = new String(bos.toByteArray(), StandardCharsets.ISO_8859_1); String[] parts = raw.split("\\r?\\n" + Pattern.quote("--" + boundary) + "\\r?\\n"); if (parts.length < 2) throw new ParseException("Signed part missing"); @@ -3341,7 +3341,7 @@ public class MessageHelper { c = c.replaceAll(" +$", ""); // trim trailing spaces try (OutputStream os = new FileOutputStream(file)) { - os.write(c.getBytes()); + os.write(c.getBytes(StandardCharsets.ISO_8859_1)); } db.attachment().setDownloaded(local.id, file.length());