Re: [evolution-patches] fix for bug #24026 (try harder not to sed in UTF-8)



here's the sub-patch that I'd still like to commit

Jeff

-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2225
diff -u -r1.2225 ChangeLog
--- ChangeLog	26 Jul 2004 21:24:20 -0000	1.2225
+++ ChangeLog	27 Jul 2004 19:26:01 -0000
@@ -1,5 +1,11 @@
 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-26  Jeffrey Stedfast  <fejj novell com>
+
 	* providers/imap4/camel-imap4-store.c (connect_to_server): Don't
 	instantiate an engine here. Instead, take an engine as an argument
 	(it has a service pointer) and connect using that. Also, if
Index: camel-charset-map.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-charset-map.c,v
retrieving revision 1.38
diff -u -r1.38 camel-charset-map.c
--- camel-charset-map.c	9 Jul 2003 19:05:12 -0000	1.38
+++ camel-charset-map.c	27 Jul 2004 19:26:01 -0000
@@ -261,12 +261,19 @@
 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";
 }
 

Attachment: smime.p7s
Description: S/MIME cryptographic signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]