fix(mail): Add encoding fallback when there are ISO char in file name. Fixes #5388.

This commit is contained in:
smizrahi
2024-03-18 15:15:14 +01:00
parent 06ea167ee5
commit e6ff9a408d
+11
View File
@@ -758,6 +758,17 @@ unsigned char GetRruleMonthNum(unsigned char a, unsigned char b) {
{
partName = [NSString stringWithUTF8String: (const char *)attachmentName->data];
if (!partName) {
// Switch to different encoding
partName = [[NSString alloc] initWithData: [NSData dataWithBytes: attachmentName->data length: strlen(attachmentName->data)] encoding:NSISOLatin1StringEncoding];
[partName autorelease];
}
if (!partName) {
// Fallback
[self warnWithFormat: @"Could not get TNEF attachment name, fallback to unamed.bin"];
partName = @"unnamed.bin";
}
type = @"application";
subtype = @"octet-stream";