[evolution-data-server/meego-eds] Find local charset from glib and convert to utf8



commit bf6b67994c43bb22f90a2d883789b40ce131a001
Author: Srinivasa Ragavan <srini linux intel com>
Date:   Thu Jun 23 08:12:32 2011 +0300

    Find local charset from glib and convert to utf8

 mail/daemon/e-mail-data-folder.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/mail/daemon/e-mail-data-folder.c b/mail/daemon/e-mail-data-folder.c
index fd092de..ad808f8 100644
--- a/mail/daemon/e-mail-data-folder.c
+++ b/mail/daemon/e-mail-data-folder.c
@@ -1022,7 +1022,7 @@ app_getmsg_operate (CamelFolder *folder, gpointer sdata, GError **error)
 	GByteArray *array;
 	CamelStream *filter_stream = NULL;
 	CamelMimeFilter *charenc = NULL;
-	static char *charset = NULL;
+	static const char *charset = NULL;
 	GConfClient *gconf;
 
 	msg = camel_folder_get_message (folder, data->uid, error);
@@ -1034,9 +1034,14 @@ app_getmsg_operate (CamelFolder *folder, gpointer sdata, GError **error)
 	filter_stream = camel_stream_filter_new (stream);
 
 	if (!charset)  {
+		gboolean ret = FALSE;
 		gconf = gconf_client_get_default ();
 		charset = gconf_client_get_string (gconf, "/apps/evolution/mail/display/charset",NULL);
 		g_object_unref (gconf);
+		if (!charset || !*charset) {
+			ret = g_get_charset (&charset);
+		}
+		micro(printf("Got Charset? %d: %s\n", ret, charset ? charset : ""));
 	}
 	
 	charenc = camel_mime_filter_charset_new (charset, "UTF-8");



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