diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-07-29 00:44:08 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-07-29 00:44:08 +0800 |
commit | 6551a127b307eec1bf331a3cb31b8fdb0d4a0f92 (patch) | |
tree | 3b162a3d83db7456d709157aee3d454176eb7aa0 | |
parent | 10bfd57c379db75b8def5b6bc1590f14484de03e (diff) | |
download | gsoc2013-evolution-6551a127b307eec1bf331a3cb31b8fdb0d4a0f92.tar gsoc2013-evolution-6551a127b307eec1bf331a3cb31b8fdb0d4a0f92.tar.gz gsoc2013-evolution-6551a127b307eec1bf331a3cb31b8fdb0d4a0f92.tar.bz2 gsoc2013-evolution-6551a127b307eec1bf331a3cb31b8fdb0d4a0f92.tar.lz gsoc2013-evolution-6551a127b307eec1bf331a3cb31b8fdb0d4a0f92.tar.xz gsoc2013-evolution-6551a127b307eec1bf331a3cb31b8fdb0d4a0f92.tar.zst gsoc2013-evolution-6551a127b307eec1bf331a3cb31b8fdb0d4a0f92.zip |
Changed the logic slightly to only match certain charsets if the locale
2004-07-26 Jeffrey Stedfast <fejj@novell.com>
* camel-charset-map.c (camel_charset_best_mask): Changed the logic
slightly to only match certain charsets if the locale matches
(Macedonians don't want to use koi8-r for example).
svn path=/trunk/; revision=26758
-rw-r--r-- | camel/ChangeLog | 12 | ||||
-rw-r--r-- | camel/camel-charset-map.c | 15 |
2 files changed, 20 insertions, 7 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 75068513a8..c07f3244cd 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2004-07-26 Jeffrey Stedfast <fejj@novell.com> + + * camel-charset-map.c (camel_charset_best_mask): Changed the logic + slightly to only match certain charsets if the locale matches + (Macedonians don't want to use koi8-r for example). + 2004-07-27 Not Zed <NotZed@Ximian.com> ** See bug #61841. @@ -23,9 +29,9 @@ Fixes #61454 * providers/groupwise/camel-groupwise-provider.c - (camel_provider_module_init): do not set - transport object for groupwise provider. We want user to - use SMTP itself instead of "Novell Groupwise" + (camel_provider_module_init): do not set transport object for + groupwise provider. We want user to use SMTP itself instead of + "Novell Groupwise" 2004-07-26 Jeffrey Stedfast <fejj@novell.com> diff --git a/camel/camel-charset-map.c b/camel/camel-charset-map.c index 9bd4f4e253..dfa7b2402e 100644 --- a/camel/camel-charset-map.c +++ b/camel/camel-charset-map.c @@ -261,12 +261,19 @@ camel_charset_step (CamelCharset *c, const char *in, int len) static const char * camel_charset_best_mask(unsigned int mask) { + const char *locale_lang, *lang; int i; - - for (i=0;i<sizeof(camel_charinfo)/sizeof(camel_charinfo[0]);i++) { - if (camel_charinfo[i].bit & mask) - return camel_charinfo[i].name; + + locale_lang = e_iconv_locale_language (); + for (i = 0; i < G_N_ELEMENTS (camel_charinfo); i++) { + if (camel_charinfo[i].bit & mask) { + lang = e_iconv_charset_language (camel_charinfo[i].name); + + if (!lang || (locale_lang && !strncmp (locale_lang, lang, 2))) + return camel_charinfo[i].name; + } } + return "UTF-8"; } |