[evolution-patches] patch for 24026 try harder to not send headers in UTF-8



Hi Jeff,

	Call me a sinner, I have created this camel patch for getting the 
charset the user sets in Composer Preferences, this will be applied only if all 
other detection mechanisms fail.
	In other words camel which was a low level library is now currently 
married to gconf, which is not as bad as it already is dependant upon gal-2.0.
Pl. check this to see whether this is a gross violation of some camel 
fundamentals.

Thanks & Regards,
Suresh
Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution/configure.in,v
retrieving revision 1.591.2.7
diff -u -p -u -r1.591.2.7 configure.in
--- configure.in	20 Sep 2003 14:33:50 -0000	1.591.2.7
+++ configure.in	16 Oct 2003 02:06:33 -0000
@@ -1065,7 +1065,7 @@ CPPFLAGS="$CPPFLAGS_save"
 
 dnl --- Flags for the various libraries we build
 
-EVO_SET_COMPILE_FLAGS(CAMEL, glib-2.0 gthread-2.0 gal-2.0 >= $GAL_REQUIRED $mozilla_nss,
+EVO_SET_COMPILE_FLAGS(CAMEL, glib-2.0 gthread-2.0 gal-2.0 gconf-2.0 >= $GAL_REQUIRED $mozilla_nss,
 		      $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $OPENSSL_CFLAGS,
 	              $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $MANUAL_NSS_LIBS $OPENSSL_LDFLAGS)
 AC_SUBST(CAMEL_CFLAGS)
Index: camel/camel-charset-map.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-charset-map.c,v
retrieving revision 1.36
diff -u -p -u -r1.36 camel-charset-map.c
--- camel/camel-charset-map.c	25 Feb 2003 19:43:22 -0000	1.36
+++ camel/camel-charset-map.c	16 Oct 2003 02:06:33 -0000
@@ -209,6 +209,9 @@ int main (void)
 #include <glib/gunicode.h>
 #include <locale.h>
 #include <ctype.h>
+#include <gal/util/e-iconv.h>
+#include <gconf/gconf.h>
+#include <gconf/gconf-client.h>
 #ifdef ENABLE_THREADS
 #include <pthread.h>
 #endif
@@ -262,6 +265,25 @@ camel_charset_step (CamelCharset *c, con
 	c->level = level;
 }
 
+static const char *
+camel_get_default_charset (void)
+{
+	GConfClient *gconf;
+	const char *charset;
+	char *buf;
+	
+	gconf = gconf_client_get_default ();
+	buf = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
+	g_object_unref (gconf);
+	
+	if (buf != NULL) {
+		charset = e_iconv_charset_name (buf);
+		g_free (buf);
+		return (charset);
+	} else
+		return "UTF-8";
+}
+
 /* gets the best charset from the mask of chars in it */
 static const char *
 camel_charset_best_mask(unsigned int mask)
@@ -272,7 +294,7 @@ camel_charset_best_mask(unsigned int mas
 		if (camel_charinfo[i].bit & mask)
 			return camel_charinfo[i].name;
 	}
-	return "UTF-8";
+	return (camel_get_default_charset());
 }
 
 const char *


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