diff --git a/ChangeLog b/ChangeLog index 9ec3df5e6..4d157a775 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-11-05 Wolfgang Sourdeau + * UI/MailPartViewers/UIxMailPartViewer.m ([UIxMailPartViewer + -flatContentAsString]): simplified method now that we know + -[NSString stringWithData:usingEncodingNamed:] has a more robust + implementation. + * UI/MailerUI/UIxMailListView.m ([UIxMailListView -showToAddress]): the answer is cached. diff --git a/UI/MailPartViewers/UIxMailPartViewer.m b/UI/MailPartViewers/UIxMailPartViewer.m index ab4ace1c3..78a8fc8ed 100644 --- a/UI/MailPartViewers/UIxMailPartViewer.m +++ b/UI/MailPartViewers/UIxMailPartViewer.m @@ -176,27 +176,19 @@ { charset = [[bodyInfo objectForKey:@"parameterList"] objectForKey: @"charset"]; - charset = [charset lowercaseString]; - if (![charset length] - || [charset isEqualToString: @"us-ascii"]) + if ([charset length]) + charset = [charset lowercaseString]; + else + charset = @"us-ascii"; + s = [NSString stringWithData: content usingEncodingNamed: charset]; + if (![s length]) { + /* latin 1 is used as a 8bit fallback charset... but does this + encoding accept any byte from 0 to 255? */ s = [[NSString alloc] initWithData: content encoding: NSISOLatin1StringEncoding]; [s autorelease]; } - else - { - s = [NSString stringWithData: content - usingEncodingNamed: charset]; - if (![s length]) - { - /* latin 1 is used as a 8bit fallback charset... but does this - encoding accept any byte from 0 to 255? */ - s = [[NSString alloc] initWithData: content - encoding: NSISOLatin1StringEncoding]; - [s autorelease]; - } - } if (!s) {