From 2934ba8dca1dd1ae21c45e53783129a2685717b2 Mon Sep 17 00:00:00 2001 From: Lauris Kaplinski Date: Wed, 3 Jan 2001 03:12:18 +0000 Subject: Little utf8 safe encoding/decoding into libxml1 brokenness svn path=/trunk/; revision=7226 --- filter/filter-input.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'filter/filter-input.c') diff --git a/filter/filter-input.c b/filter/filter-input.c index 556b895ef1..d154e9c898 100644 --- a/filter/filter-input.c +++ b/filter/filter-input.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "filter-input.h" @@ -226,9 +227,12 @@ xml_encode (FilterElement *fe) while (l) { xmlNodePtr cur; char *str = l->data; + char *encstr; cur = xmlNewChild (value, NULL, type, NULL); - xmlNodeSetContent (cur, str); + encstr = e_utf8_xml1_encode (str); + xmlNodeSetContent (cur, encstr); + g_free (encstr); l = g_list_next (l); } @@ -253,9 +257,12 @@ xml_decode (FilterElement *fe, xmlNodePtr node) n = node->childs; while (n) { if (!strcmp (n->name, type)) { + gchar *decstr; str = xmlNodeGetContent (n); - d(printf (" '%s'\n", str)); - fi->values = g_list_append (fi->values, str); + decstr = e_utf8_xml1_decode (str); + if (str) xmlFree (str); + d(printf (" '%s'\n", decstr)); + fi->values = g_list_append (fi->values, decstr); } else { g_warning ("Unknown node type '%s' encountered decoding a %s\n", n->name, type); } -- cgit