[evolution-rss/evolution-rss-0-2-0] Bug 635157 - Bad character encoding when showing full text



commit 4f05983378a360cf86edd12d322ebb1b62713eb2
Author: Lucian Langa <lucilanga gnome org>
Date:   Fri Dec 3 14:13:01 2010 +0200

    Bug 635157 - Bad character encoding when showing full text

 src/rss.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/rss.c b/src/rss.c
index 01ddb98..c87f64d 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -444,6 +444,8 @@ browser_write(gchar *string, gint length, gchar *base)
 {
 	gchar *str = string;
 	guint engine = fallback_engine();
+	xmlDoc *src = (xmlDoc *)parse_html(base, string, length);
+	gchar *encoding =  (gchar *)htmlGetMetaEncoding(src);
 	switch (engine) {
 	case 2:
 #ifdef HAVE_GECKO
@@ -474,7 +476,7 @@ browser_write(gchar *string, gint length, gchar *base)
 			WEBKIT_WEB_VIEW(rf->mozembed),
 			str,
 			"text/html",
-			NULL,
+			encoding,
 			base);
 		if (strncmp(base, "file:///fake", 12))
 			webkit_set_history(base);
@@ -490,7 +492,8 @@ void
 browser_stream_write(CamelStream *stream, gchar *base)
 {
 	GString *str = g_string_new(NULL);
-	gchar *line;
+	gchar *line, *encoding;
+	xmlDoc *src;
 	CamelStream *in = camel_stream_buffer_new(stream, CAMEL_STREAM_BUFFER_READ);
 #if EVOLUTION_VERSION < 23191
 	while ((line = camel_stream_buffer_read_line((CamelStreamBuffer *)in))) {
@@ -502,13 +505,15 @@ browser_stream_write(CamelStream *stream, gchar *base)
 		g_free(tmp);
 		line = NULL;
 	}
+	src = (xmlDoc *)parse_html(base, str->str, str->len);
+	encoding =  (gchar *)htmlGetMetaEncoding(src);
 #ifdef HAVE_WEBKIT
 #if (WEBKIT_VERSION >= 1001001)
 	webkit_web_view_load_string(
 		WEBKIT_WEB_VIEW(rf->mozembed),
 		str->str,
 		"text/html",
-		NULL,
+		encoding,
 		base);
 #else
 	webkit_web_view_load_html_string(



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