git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38938 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-08-28 14:06:35 +00:00
parent d91dd0b821
commit 501dccc404

View file

@ -5409,7 +5409,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
NSString *s = [hdr objectForKey: @"Subtype"];
NSStringEncoding enc;
if (charset == nil)
if (nil == charset)
{
/* Treat xml as a special case ... if we have no charset
* specified then we can get the charset from the xml header
@ -5418,12 +5418,16 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
{
charset = [documentClass charsetForXml: content];
}
if (charset == nil)
if (nil == charset)
{
charset = @"utf-8";
}
}
enc = [documentClass encodingFromCharset: charset];
if (NSASCIIStringEncoding == enc)
{
enc = NSUTF8StringEncoding;
}
s = [NSStringClass allocWithZone: NSDefaultMallocZone()];
s = [s initWithData: content encoding: enc];
IF_NO_GC([s autorelease];)