Monotone-Parent: 0bde24af2d54dcd7bdb9395dcc3baf170b2a7d03

Monotone-Revision: e0d6bca914a4da0940a671160d74b221a1596487

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-08-24T18:48:32
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-08-24 18:48:32 +00:00
parent 6c21591e54
commit 32a6330a97
2 changed files with 25 additions and 10 deletions

View File

@ -1,5 +1,10 @@
2007-08-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailPartViewers/UIxMailPartViewer.m ([UIxMailPartViewer
-flatContentAsString]): use latin1 when the encoding is not
specified, and to reencode data chunk which were not correctly
decoded with the original charset.
* SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -aclUsersForObjectAtPath:objectPathArray])
([SOGoAppointmentFolder -aclsForUser:uidforObjectAtPath:objectPathArray])
([SOGoAppointmentFolder -setRoles:rolesforUser:uidforObjectAtPath:objectPathArray])

View File

@ -164,7 +164,8 @@
return 0;
}
- (NSString *)flatContentAsString {
- (NSString *) flatContentAsString
{
/* Note: we even have the line count in the body-info! */
NSString *charset;
NSString *s;
@ -175,18 +176,27 @@
{
charset = [[bodyInfo objectForKey:@"parameterList"]
objectForKey: @"charset"];
// TODO: properly decode charset, might need to handle encoding?
if ([charset length] > 0)
s = [NSString stringWithData: content
usingEncodingNamed: [charset lowercaseString]];
else
charset = [charset lowercaseString];
if (![charset length]
|| [charset isEqualToString: @"us-ascii"])
{
s = [[NSString alloc] initWithData: content
encoding: NSUTF8StringEncoding];
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)
{
@ -302,7 +312,7 @@
- (NSString *) pathToAttachmentObject
{
/* this points to the SoObject representing the part, no modifications */
NSString *url, *n, *pext;
NSString *url, *n;
/* path to mail controller object */