1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Assume UTF8 for HTML (2)

This commit is contained in:
M66B 2021-04-29 14:07:55 +02:00
parent aac6a6de65
commit e113b3a5d1

View file

@ -146,10 +146,10 @@ public class text_plain extends handler_base {
String charset = ct.getParameter("charset");
if (charset == null)
// If the charset parameter is absent, use US-ASCII.
if ("text/html".equalsIgnoreCase(ct.getBaseType()))
charset = "us-ascii";
if ("us-ascii".equals(charset) &&
"text/html".equalsIgnoreCase(ct.getBaseType()))
charset = StandardCharsets.UTF_8.name();
else
charset = "us-ascii";
return MimeUtility.javaCharset(charset);
} catch (Exception ex) {
return null;