From: helge Date: Thu, 2 Jun 2005 13:37:11 +0000 (+0000) Subject: added some support for quoted printable decoding X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b09fd9410c165ef06281b782437108f8e3df82a;p=sope added some support for quoted printable decoding git-svn-id: http://svn.opengroupware.org/SOPE/trunk@820 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-ical/data/outlook2002.vcf b/sope-ical/data/outlook2002.vcf new file mode 100644 index 00000000..be80cd3e --- /dev/null +++ b/sope-ical/data/outlook2002.vcf @@ -0,0 +1,22 @@ +BEGIN:VCARD +VERSION:2.1 +N:Kontact;Outlook +FN:Outlook Kontact +NICKNAME:Nickname +ORG:OutlookCompany;abteilung +TITLE:OutlookPosition +NOTE;ENCODING=QUOTED-PRINTABLE:Kommentar=0D=0A=0D=0A +TEL;WORK;VOICE:busiphone +TEL;HOME;VOICE:privphone +TEL;CELL;VOICE:mobile +TEL;WORK;FAX:faxbusi +ADR;WORK:;office;street;City;State;12345;Germany +LABEL;WORK;ENCODING=QUOTED-PRINTABLE:office=0D=0Astreet=0D=0ACity, State 12345=0D=0AGermany +URL;WORK:http://www.opengroupware.org +ROLE:profession +BDAY:20050624 +EMAIL;PREF;INTERNET:outlook@ogo.com +FBURL;ENCODING=QUOTED-PRINTABLE:???????y=04=04A=08?=FB?=FBA? +REV:20050602T135331Z +END:VCARD + diff --git a/sope-ical/versitSaxDriver/ChangeLog b/sope-ical/versitSaxDriver/ChangeLog index a40da82b..a767579b 100644 --- a/sope-ical/versitSaxDriver/ChangeLog +++ b/sope-ical/versitSaxDriver/ChangeLog @@ -1,3 +1,9 @@ +2005-06-02 Helge Hess + + * VSSaxDriver.m: transparently decode property values if + ENCODING=QUOTED-PRINTABLE is set as an attribute (used by Outlook + vCards, needs testing against umlauts/charsets) (v4.5.16) + 2005-05-06 Helge Hess * VSSaxDriver.m: more reorganisations, added support for groupings diff --git a/sope-ical/versitSaxDriver/VSSaxDriver.m b/sope-ical/versitSaxDriver/VSSaxDriver.m index a82e1abd..722e3a71 100644 --- a/sope-ical/versitSaxDriver/VSSaxDriver.m +++ b/sope-ical/versitSaxDriver/VSSaxDriver.m @@ -24,6 +24,7 @@ #include "VSSaxDriver.h" #include "VSStringFormatter.h" #include +#include #include "common.h" @interface VSSaxTag : NSObject @@ -45,6 +46,7 @@ - (id)initWithContentString:(NSString *)_data; - (NSString *)tagName; +- (NSString *)group; - (BOOL)isStartTag; - (BOOL)isEndTag; - (BOOL)isTag; @@ -777,9 +779,16 @@ static VSStringFormatter *stringFormatter = nil; [self _endComponent:tagName value:tagValue]; } else { + // TODO: make this more generic, this one is used with Outlook vCards + if ([tagAttributes containsObject:@"ENCODING=QUOTED-PRINTABLE"]) { + // TODO: QP is charset specific! The one below decodes in Unicode! + tagValue = [tagValue stringByDecodingQuotedPrintable]; + [tagAttributes removeObject:@"ENCODING=QUOTED-PRINTABLE"]; + } + [self _reportContentAsTag:[self _mapTagName:tagName] group:[self _groupFromTagName:tagName] - withAttrs:[self _mapAttrs:tagAttributes forTag:tagName] + withAttrs:[self _mapAttrs:tagAttributes forTag:tagName] andContent:tagValue]; } diff --git a/sope-ical/versitSaxDriver/VSvCardSaxDriver.m b/sope-ical/versitSaxDriver/VSvCardSaxDriver.m index 3fe0a4c4..39431e4e 100644 --- a/sope-ical/versitSaxDriver/VSvCardSaxDriver.m +++ b/sope-ical/versitSaxDriver/VSvCardSaxDriver.m @@ -24,6 +24,9 @@ #include "VSvCardSaxDriver.h" #include "common.h" +#define XMLNS_VSvCard \ + @"http://www.ietf.org/internet-drafts/draft-dawson-vcard-xml-dtd-03.txt" + @implementation VSvCardSaxDriver static NSSet *defElementNames = nil; @@ -309,8 +312,7 @@ static NSSet *defElementNames = nil; - (id)init { if ((self = [super init]) != nil) { - [self setPrefixURI: - @"http://www.ietf.org/internet-drafts/draft-dawson-vcard-xml-dtd-03.txt"]; + [self setPrefixURI:XMLNS_VSvCard]; [self setElementMapping:[[self class] xcardMapping]]; [self setAttributeElements:defElementNames]; [self _setVCardAttributeMappings]; diff --git a/sope-ical/versitSaxDriver/Version b/sope-ical/versitSaxDriver/Version index cb19d00e..a80c05fb 100644 --- a/sope-ical/versitSaxDriver/Version +++ b/sope-ical/versitSaxDriver/Version @@ -1,3 +1,3 @@ # Version file -SUBMINOR_VERSION:=15 +SUBMINOR_VERSION:=16