diff options
author | Not Zed <NotZed@Ximian.com> | 2003-05-05 09:03:56 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-05-05 09:03:56 +0800 |
commit | 1deb422a065a30c0868203e7c9d158f9ab81acb3 (patch) | |
tree | d2bbaf438410e787c7090d9dd5264adb4adce36d | |
parent | 31289d7eb3a248073fa138e0210976f44dd6fdff (diff) | |
download | gsoc2013-evolution-1deb422a065a30c0868203e7c9d158f9ab81acb3.tar gsoc2013-evolution-1deb422a065a30c0868203e7c9d158f9ab81acb3.tar.gz gsoc2013-evolution-1deb422a065a30c0868203e7c9d158f9ab81acb3.tar.bz2 gsoc2013-evolution-1deb422a065a30c0868203e7c9d158f9ab81acb3.tar.lz gsoc2013-evolution-1deb422a065a30c0868203e7c9d158f9ab81acb3.tar.xz gsoc2013-evolution-1deb422a065a30c0868203e7c9d158f9ab81acb3.tar.zst gsoc2013-evolution-1deb422a065a30c0868203e7c9d158f9ab81acb3.zip |
[#41849]
2003-05-02 Not Zed <NotZed@Ximian.com>
[#41849]
* e-summary-rdf.c (tree_walk): check the in-memory charset, not
the transport charset when creating output.
svn path=/trunk/; revision=21101
-rw-r--r-- | my-evolution/ChangeLog | 7 | ||||
-rw-r--r-- | my-evolution/e-summary-rdf.c | 20 |
2 files changed, 22 insertions, 5 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 697a12108a..d512e6c376 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,10 @@ +2003-05-02 Not Zed <NotZed@Ximian.com> + + [#41849] + + * e-summary-rdf.c (tree_walk): check the in-memory charset, not + the transport charset when creating output. + 2003-04-18 Rodney Dawes <dobey@ximian.com> [#21499] diff --git a/my-evolution/e-summary-rdf.c b/my-evolution/e-summary-rdf.c index 70ce86687d..a0a7adf58d 100644 --- a/my-evolution/e-summary-rdf.c +++ b/my-evolution/e-summary-rdf.c @@ -180,6 +180,7 @@ tree_walk (xmlNodePtr root, int i; char *t, *u; char *tmp; + char *charset; if (r->summary->preferences == NULL) { limit = 10; @@ -187,6 +188,15 @@ tree_walk (xmlNodePtr root, limit = r->summary->preferences->limit; } + /* check in-memory encoding first, fallback to transport encoding, which may or may not be correct */ + if (r->cache->charset == XML_CHAR_ENCODING_UTF8 + || r->cache->charset == XML_CHAR_ENCODING_ASCII) { + charset = NULL; + } else { + /* bad/missing encoding, fallback to latin1 (locale?) */ + charset = r->cache->encoding ? r->cache->encoding : "iso-8859-1"; + } + /* FIXME: Need arrows */ if (r->shown == FALSE) { char *p; @@ -252,8 +262,8 @@ tree_walk (xmlNodePtr root, if (*u != '\0') g_string_sprintfa (html, "<a href=\"%s\">", u); - if (r->cache->encoding) { - char *tmp = e_utf8_from_charset_string (r->cache->encoding, t); + if (charset) { + char *tmp = e_utf8_from_charset_string (charset, t); g_string_append (html, tmp); g_free (tmp); } else { @@ -278,9 +288,9 @@ tree_walk (xmlNodePtr root, tmp = g_strdup_printf ("<LI><font size=\"-1\"><A href=\"%s\">\n", layer_find_url(item[i]->children, "link", "")); g_string_append (html, tmp); g_free (tmp); - - if (r->cache->encoding) { - char *tmp = e_utf8_from_charset_string (r->cache->encoding, p); + + if (charset) { + char *tmp = e_utf8_from_charset_string (charset, p); g_string_append (html, tmp); g_free (tmp); } else { |