 -        tmp = [NSString stringWithCString:(char *)des
 -                        length:(isoLen + desLen + isoEndLen)];
 +	tmp = [[NSString alloc] initWithData: [NSData dataWithBytes:(char *)des length:(isoLen + desLen + isoEndLen)]
-+				encoding: NSASCIIStringEncoding];
++				encoding: NSISOLatin1StringEncoding];
 +	[tmp autorelease];
        }
        else {
          [self warnWithFormat:
-@@ -193,7 +199,7 @@
- #if APPLE_Foundation_LIBRARY || NeXT_Foundation_LIBRARY
+@@ -190,11 +196,7 @@
+     }
+   }
+   
+-#if APPLE_Foundation_LIBRARY || NeXT_Foundation_LIBRARY
    data = [result dataUsingEncoding:NSISOLatin1StringEncoding];
- #else
+-#else
 -  data = [result dataUsingEncoding:NSISOLatin9StringEncoding];
-+  data = [result dataUsingEncoding:NSASCIIStringEncoding];
- #endif
+-#endif
    [result release];
    
+   return data;
 Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m
 ===================================================================
 --- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m	(révision 1626)

Index: sope-mime/NGImap4/NGImap4Client.h
===================================================================
--- sope-mime/NGImap4/NGImap4Client.h	(révision 1626)

 NGMime_INCLUDE_DIRS += \
 	-I.. -I../..			\
 	-I../../sope-core/NGStreams/	\
Index: sope-mime/NGMime/ChangeLog
===================================================================
--- sope-mime/NGMime/ChangeLog	(révision 1626)
+++ sope-mime/NGMime/ChangeLog	(copie de travail)
@@ -1,3 +1,19 @@
+2008-09-01  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+	* NGMimeRFC822DateHeaderFieldParser.m ([NGMimeRFC
+	-parseValue:ofHeaderField:]): use an 8-bit safe encoding when
+	parsing dates. Since we only consider 7-bits characters, we ensure
+	that bad user-agents can be handled more properly.
+
+	* NGMimeType.m ([NGMimeType +stringEncodingForCharset:]):
+	x-unknown encoding is now translated to an 8-bit safe encoding
+	(NSISOLatin1StringEncoding).
+
+	* NGMimeAddressHeaderFieldGenerator.m
+	([NGMimeAddressHeaderFieldGenerator
+	-generateDataForHeaderFieldNamed:value:]): encode resulting string
+	in an 8-bit safe encoding (NSISOLatin1StringEncoding).
+
 2008-01-29  Albrecht Dress  <albrecht.dress@lios-tech.com>
 
 	* fixes for OGo bug #789 (reply-to QP encoding)
Index: sope-mime/NGMime/NGMimeBodyParser.m
===================================================================
--- sope-mime/NGMime/NGMimeBodyParser.m	(révision 1626)
