]> err.no Git - sope/commitdiff
added some support for quoted printable decoding
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 2 Jun 2005 13:37:11 +0000 (13:37 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 2 Jun 2005 13:37:11 +0000 (13:37 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@820 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-ical/data/outlook2002.vcf [new file with mode: 0644]
sope-ical/versitSaxDriver/ChangeLog
sope-ical/versitSaxDriver/VSSaxDriver.m
sope-ical/versitSaxDriver/VSvCardSaxDriver.m
sope-ical/versitSaxDriver/Version

diff --git a/sope-ical/data/outlook2002.vcf b/sope-ical/data/outlook2002.vcf
new file mode 100644 (file)
index 0000000..be80cd3
--- /dev/null
@@ -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
+
index a40da82bbd8574435208c1316f63dcb565f8946a..a767579bec4d49713eb2c3d91332cd2867e1c070 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-02  Helge Hess  <helge.hess@skyrix.com>
+       
+       * 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  <helge.hess@opengroupware.org>
 
        * VSSaxDriver.m: more reorganisations, added support for groupings
index a82e1abdc87dd70631a2ea999b573b63f80c778a..722e3a712df2fb30d6ba27f99183202142678c83 100644 (file)
@@ -24,6 +24,7 @@
 #include "VSSaxDriver.h"
 #include "VSStringFormatter.h"
 #include <SaxObjC/SaxException.h>
+#include <NGExtensions/NGQuotedPrintableCoding.h>
 #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];
   }
   
index 3fe0a4c427e1ef739e55e3766452382d63b4033d..39431e4e6d6568cabde481a54fdccb53afd4e8ae 100644 (file)
@@ -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];
index cb19d00e6ced7918a3ba059adf50aa14fb9d6789..a80c05fb9aa43e6322582d902540a36087fd6366 100644 (file)
@@ -1,3 +1,3 @@
 # Version file
 
-SUBMINOR_VERSION:=15
+SUBMINOR_VERSION:=16