From eaf4b21b7b02921fdeee4cb9969d143e65d39deb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 29 Oct 2007 15:33:51 +0000 Subject: [PATCH] Monotone-Parent: 5620876c032aa2a8a213c26557e674045561bd61 Monotone-Revision: aed8c4c9e27094db008e460fe8a2157565022474 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-29T15:33:51 Monotone-Branch: ca.inverse.sogo --- SOPE/GDLContentStore/GNUmakefile | 2 +- SOPE/NGCards/CardElement.m | 26 ++++++++++++++++++++++++-- SOPE/NGCards/ChangeLog | 5 +++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/SOPE/GDLContentStore/GNUmakefile b/SOPE/GDLContentStore/GNUmakefile index 85b394e8c..5de462437 100644 --- a/SOPE/GDLContentStore/GNUmakefile +++ b/SOPE/GDLContentStore/GNUmakefile @@ -1,6 +1,6 @@ # GNUstep makefiles -include ../../../config.make +include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ./Version diff --git a/SOPE/NGCards/CardElement.m b/SOPE/NGCards/CardElement.m index 45c9180f1..cc3697556 100644 --- a/SOPE/NGCards/CardElement.m +++ b/SOPE/NGCards/CardElement.m @@ -25,6 +25,10 @@ #import #import +#import +#import +#import + #import "NSArray+NGCards.h" #import "NSDictionary+NGCards.h" #import "CardVersitRenderer.h" @@ -245,12 +249,30 @@ - (NSString *) value: (unsigned int) anInt { - NSString *value; + NSString *realValue, *value, *encoding; if ([values count] <= anInt) value = @""; else - value = [values objectAtIndex: anInt]; + { + realValue = [values objectAtIndex: anInt]; + encoding = [[self value: 0 ofAttribute: @"encoding"] lowercaseString]; + if ([encoding length]) + { + if ([encoding isEqualToString: @"quoted-printable"]) + value = [realValue stringByDecodingQuotedPrintable]; + else if ([encoding isEqualToString: @"base64"]) + value = [realValue stringByDecodingBase64]; + else + { + value = realValue; + if (![encoding isEqualToString: @"8bit"]) + [self logWithFormat: @"unknown encoding '%@'", encoding]; + } + } + else + value = realValue; + } return value; } diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 679c350ae..09ec6734b 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,8 @@ +2007-10-29 Wolfgang Sourdeau + + * CardElement.m ([CardElement -value:anInt]): added handling for + quoted-printable, base64 and 8bit encoding attributes. + 2007-08-07 Wolfgang Sourdeau * iCalRecurrenceRule.m ([iCalRecurrenceRule