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-rule.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-rule.c')
-rw-r--r-- | filter/filter-rule.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/filter/filter-rule.c b/filter/filter-rule.c index 17173a1c97..663e9d7f81 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -182,8 +182,11 @@ xml_encode (FilterRule *fr) } if (fr->name) { + gchar *encstr; work = xmlNewNode (NULL, "title"); - xmlNodeSetContent (work, fr->name); + encstr = e_utf8_xml1_encode (fr->name); + xmlNodeSetContent (work, encstr); + g_free (encstr); xmlAddChild (node, work); } @@ -264,8 +267,13 @@ xml_decode (FilterRule *fr, xmlNodePtr node, RuleContext *f) if (!strcmp (work->name, "partset")) { load_set (work, fr, f); } else if (!strcmp (work->name, "title")) { - if (!fr->name) - fr->name = xmlNodeGetContent (work); + if (!fr->name) { + gchar *str, *decstr; + str = xmlNodeGetContent (work); + decstr = e_utf8_xml1_decode (str); + if (str) xmlFree (str); + fr->name = decstr; + } } work = work->next; } |