diff options
author | Lauris Kaplinski <lauris@src.gnome.org> | 2001-01-03 11:12:18 +0800 |
---|---|---|
committer | Lauris Kaplinski <lauris@src.gnome.org> | 2001-01-03 11:12:18 +0800 |
commit | 2934ba8dca1dd1ae21c45e53783129a2685717b2 (patch) | |
tree | 57adaf91e5fdef776a48f112f0ad9cd64ae68bc5 /filter/filter-input.c | |
parent | 33e0d0e847cee22aaa127e3ae1e75c27cc41f5b4 (diff) | |
download | gsoc2013-evolution-2934ba8dca1dd1ae21c45e53783129a2685717b2.tar.gz gsoc2013-evolution-2934ba8dca1dd1ae21c45e53783129a2685717b2.tar.zst gsoc2013-evolution-2934ba8dca1dd1ae21c45e53783129a2685717b2.zip |
Little utf8 safe encoding/decoding into libxml1 brokenness
svn path=/trunk/; revision=7226
Diffstat (limited to 'filter/filter-input.c')
-rw-r--r-- | filter/filter-input.c | 13 |
1 files changed, 10 insertions, 3 deletions
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 <gnome.h> #include <regex.h> +#include <gnome-xml/xmlmemory.h> #include <gal/widgets/e-unicode.h> #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); } |