diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-07-20 08:08:50 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-07-20 08:08:50 +0800 |
commit | 25ea76f3a782b2cd0a9ed65216203b7d7472ef57 (patch) | |
tree | b9fbdc13ea42b51c99ec31c54b883c78eaff132d /camel/camel-mime-filter-charset.c | |
parent | 0ce3b207745b7094c31a4713f8bc08cbe926b425 (diff) | |
download | gsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.tar gsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.tar.gz gsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.tar.bz2 gsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.tar.lz gsoc2013-evolution-25ea76f3a782b2cd0a9ed65216203b7d7472ef57.tar.xz 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-filter-charset.c')
-rw-r--r-- | camel/camel-mime-filter-charset.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c index 808e4064a7..d3fb126970 100644 --- a/camel/camel-mime-filter-charset.c +++ b/camel/camel-mime-filter-charset.c @@ -25,6 +25,7 @@ #include <errno.h> #include "camel-mime-filter-charset.h" +#include "camel-charset-map.h" #define d(x) @@ -226,18 +227,22 @@ camel_mime_filter_charset_new (void) } CamelMimeFilterCharset * -camel_mime_filter_charset_new_convert(const char *from_charset, const char *to_charset) +camel_mime_filter_charset_new_convert (const char *from_charset, const char *to_charset) { CamelMimeFilterCharset *new = CAMEL_MIME_FILTER_CHARSET (camel_object_new (camel_mime_filter_charset_get_type ())); - - new->ic = iconv_open(to_charset, from_charset); + + from_charset = camel_charset_get_iconv_friendly_name (from_charset); + to_charset = camel_charset_get_iconv_friendly_name (to_charset); + + new->ic = iconv_open (to_charset, from_charset); if (new->ic == (iconv_t) -1) { g_warning("Cannot create charset conversion from %s to %s: %s", from_charset, to_charset, strerror(errno)); - camel_object_unref((CamelObject *)new); + camel_object_unref ((CamelObject *)new); new = NULL; } else { - new->from = g_strdup(from_charset); - new->to = g_strdup(to_charset); + new->from = g_strdup (from_charset); + new->to = g_strdup (to_charset); } + return new; } |