mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
fixup conversion to 7bit-safe
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39842 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0adeacda9a
commit
48ab2e60e0
1 changed files with 22 additions and 11 deletions
|
@ -5734,19 +5734,30 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
GSMimeHeader *h = [self headerNamed: @"content-transfer-encoding"];
|
||||
NSString *v = [h value];
|
||||
|
||||
if ([v isEqual: @"binary"] == YES || [v isEqual: @"8bit"] == YES)
|
||||
if (nil == h
|
||||
|| YES == [v isEqualToString: @"binary"]
|
||||
|| YES == [v isEqualToString: @"8bit"])
|
||||
{
|
||||
h = [self headerNamed: @"content-type"];
|
||||
v = [h value];
|
||||
NSString *t = [[doc headerNamed @"content-type"] value]
|
||||
|
||||
if ([v hasPrefix: @"text/"])
|
||||
{
|
||||
[h setValue: @"quoted-printable"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[h setValue: @"base64"];
|
||||
}
|
||||
if (YES == [t hasPrefix: @"text/"])
|
||||
{
|
||||
t = @"quoted-printable";
|
||||
}
|
||||
else
|
||||
{
|
||||
t = @"base64";
|
||||
}
|
||||
if (nil == h)
|
||||
{
|
||||
[doc setHeader: @"Content-Transfer-Encoding"
|
||||
value: t
|
||||
parameters: nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[h setValue: t];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue