fix(activesync): Wrong decoding emails in Outlook via EAS. Force utf-8 when contnet-type is different than html part. Original fix from tfu. Fixes #5664

This commit is contained in:
smizrahi
2023-04-26 09:49:54 +02:00
parent d9ac1b916f
commit 39ab482b7f

View File

@@ -410,7 +410,7 @@ struct GlobalObjectId {
charset = [[[self lookupInfoForBodyPart: key] objectForKey: @"parameterList"] objectForKey: @"charset"];
if (![charset length])
if (![charset length] || [charset caseInsensitiveCompare: @"us-ascii"] == NSOrderedSame)
charset = @"utf-8";
s = [NSString stringWithData: d usingEncodingNamed: charset];
@@ -708,7 +708,7 @@ struct GlobalObjectId {
charset = [[[self lookupInfoForBodyPart: @""] objectForKey: @"parameterList"] objectForKey: @"charset"];
if (![charset length])
if (![charset length] || [charset caseInsensitiveCompare: @"us-ascii"] == NSOrderedSame)
charset = @"utf-8";
d = [[self fetchPlainTextParts] objectForKey: @""];