fix(mail): force TNEF body parts to be decoded in UTF-8

This commit is contained in:
Francis Lachapelle
2022-04-08 11:21:48 -04:00
parent dcc2ebcd4a
commit 2cf77b6145
+11 -1
View File
@@ -825,8 +825,14 @@ unsigned char GetRruleMonthNum(unsigned char a, unsigned char b) {
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
{
@@ -884,6 +890,10 @@ unsigned char GetRruleMonthNum(unsigned char a, unsigned char b) {
[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]];