Check ASCII for UTF8 too

This commit is contained in:
M66B 2020-08-30 10:54:40 +02:00
parent 5f82df7a5f
commit 9c064aff80
1 changed files with 2 additions and 1 deletions

View File

@ -1725,7 +1725,8 @@ public class MessageHelper {
warnings.add(context.getString(R.string.title_no_charset, charset));
if (part.isMimeType("text/plain")) {
if (TextUtils.isEmpty(charset) && Helper.isUTF8(result)) {
if ((TextUtils.isEmpty(charset) || charset.equalsIgnoreCase(StandardCharsets.US_ASCII.name())) &&
Helper.isUTF8(result)) {
Log.i("Charset plain=UTF8");
result = new String(result.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
}