 ===================================================================
 --- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m	(révision 1625)
 +++ sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m	(copie de travail)
+@@ -93,7 +93,7 @@
+   
+   while ((obj = [enumerator nextObject]) != nil) {
+     NSString   *tmp;
+-    char       *buffer;
++    unichar       *buffer;
+     unsigned   bufLen, cnt;
+     BOOL       doEnc;
+     
+@@ -105,10 +105,10 @@
+     }
+     
+     tmp    = [obj displayName];
+-    bufLen = [tmp cStringLength];
++    bufLen = [tmp length];
+     
+-    buffer = calloc(bufLen + 10, sizeof(char));
+-    [tmp getCString:buffer];
++    buffer = calloc(bufLen, sizeof(unichar));
++    [tmp getCharacters:buffer];
+     
+     cnt   = 0;
+     doEnc = NO;
+@@ -117,11 +117,11 @@
+       /* must encode chars outside ASCII 33..60, 62..126 ranges [RFC 2045, Sect. 6.7]
+        * RFC 2047, Sect. 4.2 also requires chars 63 and 95 to be encoded
+        * For spaces, quotation is fine */
+-      if ((unsigned char)buffer[cnt] < 32 ||
+-	  (unsigned char)buffer[cnt] == 61 ||
+-	  (unsigned char)buffer[cnt] == 63 ||
+-          (unsigned char)buffer[cnt] == 95 ||
+-	  (unsigned char)buffer[cnt] > 126) {
++      if ((unichar)buffer[cnt] < 32 ||
++	  (unichar)buffer[cnt] == 61 ||
++	  (unichar)buffer[cnt] == 63 ||
++          (unichar)buffer[cnt] == 95 ||
++	  (unichar)buffer[cnt] > 126) {
+         doEnc = YES;
+         break;
+       }
 @@ -130,8 +130,13 @@
      
      if (doEnc) {

Index: sope-mime/NGImap4/NGImap4Client.m
===================================================================
--- sope-mime/NGImap4/NGImap4Client.m	(révision 1625)

 #endif
 
         bufLen  = [data length];
@@ -162,8 +167,9 @@
                                     des + isoLen, desLen - isoLen);
       if ((int)desLen != -1) {
         memcpy(des + isoLen + desLen, isoEnd, isoEndLen);
-        tmp = [NSString stringWithCString:(char *)des
-                        length:(isoLen + desLen + isoEndLen)];
+	tmp = [[NSString alloc] initWithData: [NSData dataWithBytes:(char *)des length:(isoLen + desLen + isoEndLen)]
+				encoding: NSASCIIStringEncoding];
+	[tmp autorelease];
       }
       else {
         [self warnWithFormat:
@@ -193,7 +199,7 @@
 #if APPLE_Foundation_LIBRARY || NeXT_Foundation_LIBRARY
   data = [result dataUsingEncoding:NSISOLatin1StringEncoding];
 #else
-  data = [result dataUsingEncoding:NSISOLatin9StringEncoding];
+  data = [result dataUsingEncoding:NSASCIIStringEncoding];
 #endif
   [result release];
   
Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m
===================================================================
--- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m	(révision 1625)
