Author: rfm
Date: Wed Jun  8 13:49:42 2016
New Revision: 39853

URL: http://svn.gna.org/viewcvs/gnustep?rev=39853&view=rev
Log:
tweak

Modified:
    libs/base/trunk/Source/Additions/GSMime.m

Modified: libs/base/trunk/Source/Additions/GSMime.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/Additions/GSMime.m?rev=39853&r1=39852&r2=39853&view=diff
==============================================================================
--- libs/base/trunk/Source/Additions/GSMime.m   (original)
+++ libs/base/trunk/Source/Additions/GSMime.m   Wed Jun  8 13:49:42 2016
@@ -6604,9 +6604,18 @@
          unsigned char *bytes = (unsigned char*)[d bytes];
          NSUInteger    length = [d length];
          BOOL          hadCarriageReturn = NO;
+          BOOL          want7Bit = YES;
          NSUInteger    lineLength = 0;
          NSUInteger    i;
 
+          if ([encoding isEqualToString: @"8bit"])
+            {
+              want7Bit = NO;
+            }
+
+          /* Check to see if the data is actually compatible (unaltered)
+           * with the specified content transfer encoding.
+           */
          for (i = 0; i < length; i++)
            {
              unsigned char     c = bytes[i];
@@ -6649,16 +6658,15 @@
 
          if (encoding != nil)
            {
-             if (nil == enc)
-               {
-                  enc = [self setHeader: @"Content-Transfer-Encoding"
-                                  value: encoding
-                               parameters: nil];
-               }
-             else
-               {
-                 [enc setValue: encoding];
-               }
+              /* Not OK ... need to change conten transfer encoding.
+               */
+              if (YES == want7Bit)
+                {
+                  encoding = @"quoted-printable";
+                }
+              enc = [self setHeader: @"Content-Transfer-Encoding"
+                              value: encoding
+                         parameters: nil];
            }
        }
     }


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to