mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-10 15:58:52 +00:00
Monotone-Parent: f89606284edb167179a499cd095ed71483dc5e1b
Monotone-Revision: 0cdd246c0f5539b89fd7637c0d0589c8383fe4df Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-11-17T22:07:57 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2006-11-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
|
||||
-stringForData:partInfo:]): take the encoding into account and
|
||||
translate the text to "normal" before processing the charset data.
|
||||
|
||||
2006-11-15 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/generic.js: the progress indicator is on
|
||||
|
||||
@@ -570,23 +570,34 @@ static BOOL debugSoParts = NO;
|
||||
/* convert parts to strings */
|
||||
|
||||
- (NSString *)stringForData:(NSData *)_data partInfo:(NSDictionary *)_info {
|
||||
NSString *charset;
|
||||
NSString *s;
|
||||
NSString *charset, *encoding, *s;
|
||||
NSData *mailData;
|
||||
|
||||
if (![_data isNotNull])
|
||||
return nil;
|
||||
|
||||
s = nil;
|
||||
|
||||
encoding = [[_info objectForKey:@"encoding"] lowercaseString];
|
||||
|
||||
if ([encoding isEqualToString: @"7bit"]
|
||||
|| [encoding isEqualToString: @"8bit"])
|
||||
mailData = _data;
|
||||
else if ([encoding isEqualToString: @"base64"])
|
||||
mailData = [_data dataByDecodingBase64];
|
||||
else if ([encoding isEqualToString: @"quoted-printable"])
|
||||
mailData = [_data dataByDecodingQuotedPrintable];
|
||||
|
||||
charset = [[_info valueForKey:@"parameterList"] valueForKey:@"charset"];
|
||||
if ([charset isNotNull] && [charset length] > 0)
|
||||
s = [NSString stringWithData:_data usingEncodingNamed:charset];
|
||||
|
||||
if (s == nil) { /* no charset provided, fall back to UTF-8 */
|
||||
s = [[NSString alloc] initWithData:_data encoding:NSUTF8StringEncoding];
|
||||
s = [s autorelease];
|
||||
}
|
||||
|
||||
charset = [[_info valueForKey:@"parameterList"] valueForKey: @"charset"];
|
||||
if (![charset length])
|
||||
{
|
||||
s = [[NSString alloc] initWithData:mailData encoding:NSUTF8StringEncoding];
|
||||
[s autorelease];
|
||||
}
|
||||
else
|
||||
s = [NSString stringWithData: mailData
|
||||
usingEncodingNamed: charset];
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user