mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Guess convert plain text to UTF8
This commit is contained in:
parent
3d296d66cf
commit
1cd3f84ed6
1 changed files with 5 additions and 0 deletions
|
@ -1729,6 +1729,11 @@ public class MessageHelper {
|
|||
warnings.add(context.getString(R.string.title_no_charset, charset));
|
||||
|
||||
if (part.isMimeType("text/plain")) {
|
||||
if (Helper.isUTF8(result)) {
|
||||
Log.i("Charset plain=UTF8");
|
||||
result = new String(result.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
if ("flowed".equalsIgnoreCase(ct.getParameter("format")))
|
||||
result = HtmlHelper.flow(result);
|
||||
result = "<div x-plain=\"true\">" + HtmlHelper.formatPre(result) + "</div>";
|
||||
|
|
Loading…
Reference in a new issue