Skip to content

Commit

Permalink
fix(activesync): Wrong decoding emails in Outlook via EAS. Force utf-…
Browse files Browse the repository at this point in the history
…8 when contnet-type is different than html part. Original fix from tfu. Fixes #5664
  • Loading branch information
WoodySlum committed Apr 26, 2023
1 parent d9ac1b9 commit 39ab482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ActiveSync/SOGoMailObject+ActiveSync.m
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ - (NSData *) _preferredBodyDataInMultipartUsingType: (int) theType

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];
Expand Down Expand Up @@ -708,7 +708,7 @@ - (NSData *) _preferredBodyDataUsingType: (int) theType

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: @""];
Expand Down

0 comments on commit 39ab482

Please sign in to comment.