[#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
This commit is contained in:
@ -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>
|
2003-04-18 Rodney Dawes <dobey@ximian.com>
|
||||||
|
|
||||||
[#21499]
|
[#21499]
|
||||||
|
@ -180,6 +180,7 @@ tree_walk (xmlNodePtr root,
|
|||||||
int i;
|
int i;
|
||||||
char *t, *u;
|
char *t, *u;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
char *charset;
|
||||||
|
|
||||||
if (r->summary->preferences == NULL) {
|
if (r->summary->preferences == NULL) {
|
||||||
limit = 10;
|
limit = 10;
|
||||||
@ -187,6 +188,15 @@ tree_walk (xmlNodePtr root,
|
|||||||
limit = r->summary->preferences->limit;
|
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 */
|
/* FIXME: Need arrows */
|
||||||
if (r->shown == FALSE) {
|
if (r->shown == FALSE) {
|
||||||
char *p;
|
char *p;
|
||||||
@ -252,8 +262,8 @@ tree_walk (xmlNodePtr root,
|
|||||||
if (*u != '\0')
|
if (*u != '\0')
|
||||||
g_string_sprintfa (html, "<a href=\"%s\">", u);
|
g_string_sprintfa (html, "<a href=\"%s\">", u);
|
||||||
|
|
||||||
if (r->cache->encoding) {
|
if (charset) {
|
||||||
char *tmp = e_utf8_from_charset_string (r->cache->encoding, t);
|
char *tmp = e_utf8_from_charset_string (charset, t);
|
||||||
g_string_append (html, tmp);
|
g_string_append (html, tmp);
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
} else {
|
} else {
|
||||||
@ -279,8 +289,8 @@ tree_walk (xmlNodePtr root,
|
|||||||
g_string_append (html, tmp);
|
g_string_append (html, tmp);
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
|
||||||
if (r->cache->encoding) {
|
if (charset) {
|
||||||
char *tmp = e_utf8_from_charset_string (r->cache->encoding, p);
|
char *tmp = e_utf8_from_charset_string (charset, p);
|
||||||
g_string_append (html, tmp);
|
g_string_append (html, tmp);
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user