mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-19 10:25:27 +00:00
Monotone-Parent: 6b88d1d42fb21659bd47fc0d1167769d8101775f
Monotone-Revision: 633db895fe1d25a8339861d7d55a062abc56205f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-05T22:40:46 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -176,27 +176,19 @@
|
||||
{
|
||||
charset = [[bodyInfo objectForKey:@"parameterList"]
|
||||
objectForKey: @"charset"];
|
||||
charset = [charset lowercaseString];
|
||||
if (![charset length]
|
||||
|| [charset isEqualToString: @"us-ascii"])
|
||||
if ([charset length])
|
||||
charset = [charset lowercaseString];
|
||||
else
|
||||
charset = @"us-ascii";
|
||||
s = [NSString stringWithData: content usingEncodingNamed: charset];
|
||||
if (![s length])
|
||||
{
|
||||
/* latin 1 is used as a 8bit fallback charset... but does this
|
||||
encoding accept any byte from 0 to 255? */
|
||||
s = [[NSString alloc] initWithData: content
|
||||
encoding: NSISOLatin1StringEncoding];
|
||||
[s autorelease];
|
||||
}
|
||||
else
|
||||
{
|
||||
s = [NSString stringWithData: content
|
||||
usingEncodingNamed: charset];
|
||||
if (![s length])
|
||||
{
|
||||
/* latin 1 is used as a 8bit fallback charset... but does this
|
||||
encoding accept any byte from 0 to 255? */
|
||||
s = [[NSString alloc] initWithData: content
|
||||
encoding: NSISOLatin1StringEncoding];
|
||||
[s autorelease];
|
||||
}
|
||||
}
|
||||
|
||||
if (!s)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user