From 740a3b4b8c6c0aee40494f475ee9f926fae1835b Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 14 Oct 2020 12:29:38 +0200 Subject: [PATCH] Remove accents from wearable preview text --- app/src/main/java/eu/faircode/email/Core.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 3103deaddd..2046848b3e 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -83,6 +83,7 @@ import java.net.SocketException; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.text.DateFormat; +import java.text.Normalizer; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -3969,8 +3970,12 @@ class Core { if (!TextUtils.isEmpty(preview)) sb.append(preview); } - if (sb.length() > 0) - mbuilder.setContentText(sb.toString()); + if (sb.length() > 0) { + String ascii = Normalizer + .normalize(sb.toString(), Normalizer.Form.NFKD) + .replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); + mbuilder.setContentText(ascii); + } // Device StringBuilder sbm = new StringBuilder();