mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 18:21:04 +00:00
When parsing documents with non-standard charset, set the charset actually
used in the content type so that we can unparse the data properly too. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19831 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a9cde13d8e
commit
3a56cda1ce
2 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-05-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSMime.m: When using non-ascii default characterset
|
||||
ensure that the content type header has the appropriate
|
||||
charset parameter added during parsing, so unparsing will
|
||||
work correctly.
|
||||
|
||||
2004-08-05 01:59 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSDistantObject.m (DO_FORWARD_INVOCATION): Warning if we
|
||||
|
|
|
@ -2242,6 +2242,27 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
|
|||
if (typeInfo == nil)
|
||||
{
|
||||
stringEncoding = _defaultEncoding;
|
||||
if (stringEncoding != NSASCIIStringEncoding)
|
||||
{
|
||||
NSString *charset;
|
||||
|
||||
if (typeInfo == nil)
|
||||
{
|
||||
typeInfo = [GSMimeHeader new];
|
||||
[typeInfo setName: @"content-type"];
|
||||
[typeInfo setValue: @"text/plain"];
|
||||
[typeInfo setObject: @"text"
|
||||
forKey: @"Type"];
|
||||
[typeInfo setObject: @"plain"
|
||||
forKey: @"Subtype"];
|
||||
[document setHeader: typeInfo];
|
||||
RELEASE(typeInfo);
|
||||
}
|
||||
charset = [GSMimeDocument charsetFromEncoding:
|
||||
stringEncoding];
|
||||
[typeInfo setParameter: charset
|
||||
forKey: @"charset"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue