git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39853 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-06-08 11:49:42 +00:00
parent 5cf471c70f
commit 8180e928f0

View file

@ -6604,9 +6604,18 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
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 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
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];
}
}
}