Monotone-Parent: 1e0cd0c819f1c4c90f09af9a26fb932910568542

Monotone-Revision: 6de7608d4605876bb174df7847a81f7e1cfb7c04

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-11-26T14:24:32
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-11-26 14:24:32 +00:00
parent 741ae9a281
commit 78c3357524
3 changed files with 28 additions and 39 deletions

View File

@ -1,3 +1,14 @@
2007-11-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailPartViewers/UIxMailPartViewer.m
([-fallbackStringEncoding]): removed method.
([UIxMailPartViewer -flatContentAsString]): we no longer use [self
fallbackStringEncoding]. Instead we directly specify
NSISOLatin1StringEncoding if UTF-8 has failed.
* UI/MailPartViewers/UIxMailPartICalViewer.m
([-fallbackStringEncoding]): removed method.
2007-11-25 Ludovic Marcotte <ludovic@inverse.ca> 2007-11-25 Ludovic Marcotte <ludovic@inverse.ca>
* SoObjects/Mailer/SOGoMailForward.m * SoObjects/Mailer/SOGoMailForward.m

View File

@ -76,24 +76,6 @@
[item release]; item = nil; [item release]; item = nil;
} }
/* raw content handling */
- (NSStringEncoding) fallbackStringEncoding
{
/*
iCalendar invitations sent by Outlook 2002 have the annoying bug that the
mail states an UTF-8 content encoding but the actual iCalendar content is
encoding in Latin-1 (or Windows Western?).
As a result the content decoding will fail (TODO: always?). In this case we
try to decode with Latin-1.
Note: we could check for the Outlook x-mailer, but it was considered better
to try Latin-1 as a fallback in any case (be tolerant).
*/
return NSISOLatin1StringEncoding;
}
/* accessors */ /* accessors */
- (iCalCalendar *) inCalendar - (iCalCalendar *) inCalendar

View File

@ -159,11 +159,6 @@
return content; return content;
} }
- (NSStringEncoding) fallbackStringEncoding
{
return 0;
}
- (NSString *) flatContentAsString - (NSString *) flatContentAsString
{ {
/* Note: we even have the line count in the body-info! */ /* Note: we even have the line count in the body-info! */
@ -191,23 +186,24 @@
if (!s) if (!s)
{ {
/* /*
Note: this can happend with iCalendar invitations sent by Outlook 2002. iCalendar invitations sent by Outlook 2002 have the annoying bug that the
It will mark the content as UTF-8 but actually deliver it as mail states an UTF-8 content encoding but the actual iCalendar content is
Latin-1 (or Windows encoding?). encoding in Latin-1 (or Windows Western?).
As a result the content decoding will fail (TODO: always?). In this case we
try to decode with Latin-1.
Note: we could check for the Outlook x-mailer, but it was considered better
to try Latin-1 as a fallback in any case (be tolerant).
*/ */
[self errorWithFormat:@"could not convert content to text, charset: '%@'",
charset]; s = [[NSString alloc] initWithData:content
if ([self fallbackStringEncoding] > 0) encoding: NSISOLatin1StringEncoding];
{ if (!s)
s = [[NSString alloc] initWithData:content [self errorWithFormat: @"an attempt to use"
encoding: [self fallbackStringEncoding]]; @" NSISOLatin1StringEncoding as callback failed"];
if (s) [s autorelease];
[s autorelease];
else
[self errorWithFormat:
@"an attempt to use fallback encoding failed to."];
}
} }
} }
else else