If a charset is specified which does not match the string contents,

override it.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16901 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-06-11 13:10:19 +00:00
parent f00d10f500
commit 04c2ed4343

View file

@ -3560,8 +3560,12 @@ static NSCharacterSet *tokenSet = nil;
enc = [GSMimeDocument encodingFromCharset: charset];
d = [content dataUsingEncoding: enc];
if (d == nil)
{
charset = nil; // String can't be converted to this charset
}
}
else
if (charset == nil)
{
charset = selectCharacterSet(content, &d);
[hdr setParameter: charset forKey: @"charset"];