aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-message.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-20 08:08:50 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-20 08:08:50 +0800
commit25ea76f3a782b2cd0a9ed65216203b7d7472ef57 (patch)
treeb9fbdc13ea42b51c99ec31c54b883c78eaff132d /camel/camel-mime-message.c
parent0ce3b207745b7094c31a4713f8bc08cbe926b425 (diff)
downloadgsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.tar.gz
gsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.tar.zst
gsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.zip
Convert to the iconv-friendly charset names.
2001-07-19 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-charset.c (camel_mime_filter_charset_new_convert): Convert to the iconv-friendly charset names. * providers/imap/camel-imap-store.c (create_folder): Fixed a compiler warning about returning without a value in a non-void function. Blah. * camel-mime-part.c (process_header): Pass the locale charset as the default_charset to header_decode_string(). * camel-folder-summary.c (camel_folder_summary_format_string): Pass the locale charset as the default_charset to header_decode_string(). (content_info_new): Same. * camel-mime-message.c (process_header): Pass the locale charset as the default_charset to header_decode_string(). * camel-mime-utils.c (append_8bit): New helper function who's purpose is similar to append_latin1() but for 8bit text that we are assuming is not latin1. (header_decode_text): Now takes a default_charset parameter and calls append_8bit when appropriate. (header_decode_string): Also takes a default_charset parameter now. (header_decode_mailbox): Pass NULL as the default_charset to header_decode_string(). svn path=/trunk/; revision=11250
Diffstat (limited to 'camel/camel-mime-message.c')
-rw-r--r--camel/camel-mime-message.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index 8b42765656..cbae7fb3f1 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -513,6 +513,7 @@ process_header (CamelMedium *medium, const char *header_name, const char *header
CamelHeaderType header_type;
CamelMimeMessage *message = CAMEL_MIME_MESSAGE (medium);
CamelInternetAddress *addr;
+ const char *charset;
header_type = (CamelHeaderType)g_hash_table_lookup (header_name_table, header_name);
switch (header_type) {
@@ -529,8 +530,9 @@ process_header (CamelMedium *medium, const char *header_name, const char *header
camel_address_decode (CAMEL_ADDRESS (message->reply_to), header_value);
break;
case HEADER_SUBJECT:
- g_free(message->subject);
- message->subject = g_strstrip (header_decode_string (header_value));
+ g_free (message->subject);
+ charset = camel_charset_locale_name ();
+ message->subject = g_strstrip (header_decode_string (header_value, charset));
break;
case HEADER_TO:
case HEADER_CC:
@@ -719,7 +721,7 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
if (istext)
charsetin = camel_mime_filter_bestenc_get_best_charset (bestenc);
- d(printf("charsetin = %s\n", charsetin));
+ d(printf("charsetin = %s\n", charsetin ? charsetin : "(null)"));
/* if we have US-ASCII, or we're not doing text, we dont need to bother with the rest */
if (charsetin != NULL && (required & CAMEL_BESTENC_GET_CHARSET) != 0) {