Skip to content

Commit

Permalink
(fix) handle more broken mails (fixes #4513)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Jun 13, 2019
1 parent 991fac0 commit 4fc515b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions UI/MailPartViewers/UIxMailPartHTMLViewer.m
Expand Up @@ -846,6 +846,13 @@ - (void) _parseContent
if (enc == XML_CHAR_ENCODING_UTF8)
{
s = [[NSString alloc] initWithData: preparsedContent encoding: NSUTF8StringEncoding];

// Again, In some rare cases (like #4513), we can get utterly broken email messages where
// HTML parts are wrongly encoded. We try to fall back to UTF-8 if that happens and
// if it still happens, we fall back to ISO-Latin-1.
if (!s)
s = [[NSString alloc] initWithData: preparsedContent encoding: NSISOLatin1StringEncoding];

preparsedContent = [[s safeString] dataUsingEncoding: NSUTF8StringEncoding];
RELEASE(s);
}
Expand Down

1 comment on commit 4fc515b

@Eslam-Basyouni
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can i resolve this issue in current installed version , kindly look at https://lists.inverse.ca/sogo/arc/users/2019-07/msg00001.html

Please sign in to comment.