Skip to content

Commit

Permalink
fix(mail): force TNEF body parts to be decoded in UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Apr 8, 2022
1 parent dcc2ebc commit 2cf77b6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion SoObjects/Mailer/SOGoTNEFMailBodyPart.m
Original file line number Diff line number Diff line change
Expand Up @@ -825,8 +825,14 @@ - (void) setPart: (NGMimeBodyPart *) newPart
ASSIGN (part, newPart);
if (newPart)
{
NSMutableDictionary *info;

info = [NSMutableDictionary dictionaryWithDictionary: [newPart bodyInfo]];
if ([newPart encoding])
[info setObject: [newPart encoding]
forKey: @"encoding"];
[self setFilename: [[newPart bodyInfo] filename]];
[self setPartInfo: [newPart bodyInfo]];
[self setPartInfo: info];
}
else
{
Expand Down Expand Up @@ -884,6 +890,10 @@ - (NGMimeBodyPart *) bodyPartForData: (NSData *) _data
[map setObject: [NSString stringWithFormat: @"%@/%@", _type, _subtype]
forKey: @"content-type"];

// Encoding
[map setObject: @"utf-8"
forKey: @"content-transfer-encoding"];

/* prepare body content */

content = [NSData dataWithBytes: [_data bytes] length: [_data length]];
Expand Down

0 comments on commit 2cf77b6

Please sign in to comment.