]> err.no Git - sope/blobdiff - sope-ical/versitSaxDriver/VSSaxDriver.m
converted all Xcode projects from Xcode < 2.1 to 2.1
[sope] / sope-ical / versitSaxDriver / VSSaxDriver.m
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];
   }