2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 check whether the quoted printable MIME decoding works ...
26 #include <NGMail/NGMimeMessageParser.h>
29 static void test(void) {
30 static unsigned char *fields[] = {
31 "attachment; filename=\"Mappe langerp=?iso-8859-15?q?=FC=E4=F6=20Name=F6=F6=F6=201234456=2Exls?=\"",
32 "Umlaute: =?iso-8859-15?q?=FC=E4=F6?=",
33 "keine Umlaute: =?iso-8859-15?q?keine Umlaute?=",
34 "=?iso-8859-15?q?keine Umlaute?=",
35 "=?iso-8859-15?q?=FC=E4=F6?=",
44 for (i = 0; (field = fields[i]); i++) {
48 NSLog(@"decoding field: '%s'", field);
49 fieldData = [NSData dataWithBytes:field length:strlen(field)];
50 NSLog(@" length: %i", [fieldData length]);
52 result = [fieldData decodeQuotedPrintableValueOfMIMEHeaderField:
53 @"content-disposition"];
56 NSLog(@" got no result for field data %@ !!!", fieldData);
58 else if ([result isKindOfClass:[NSData class]]) {
59 NSLog(@" got a data, length %i: %@", [result length], result);
61 else if ([result isKindOfClass:[NSString class]]) {
62 NSLog(@" got a string, length %i: '%@'", [result length], result);
65 NSLog(@" got an unexpected object, class %@: %@",
66 NSStringFromClass([result class]), result);
71 int main(int argc, char **argv, char **env) {
72 NSAutoreleasePool *pool;
74 pool = [NSAutoreleasePool new];
76 #if LIB_FOUNDATION_LIBRARY
77 [NSProcessInfo initializeWithArguments:argv count:argc environment:env];