changeset 34:a544b376b6f0

use proper utf-8 encoding for parsing xml in parameters
author Goffi <goffi@goffi.org>
date Sun, 13 Dec 2009 18:36:20 +1100 (2009-12-13)
parents b9bb5d8e0cc7
children c45deebb40a5
files frontends/wix/param.py tools/memory.py
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/wix/param.py	Tue Dec 08 09:54:44 2009 +0100
+++ b/frontends/wix/param.py	Sun Dec 13 18:36:20 2009 +1100
@@ -57,7 +57,7 @@
         panel=wx.Panel(self.notebook)
         panel.sizer = wx.BoxSizer(wx.VERTICAL)
 
-        cat_dom = minidom.parseString(self.host.bridge.getParamsForCategory(category))
+        cat_dom = minidom.parseString(self.host.bridge.getParamsForCategory(category).encode('utf-8'))
         
         for param in cat_dom.documentElement.getElementsByTagName("param"):
             name = param.getAttribute("name")
--- a/tools/memory.py	Tue Dec 08 09:54:44 2009 +0100
+++ b/tools/memory.py	Sun Dec 13 18:36:20 2009 +1100
@@ -37,7 +37,7 @@
     ### TODO: add desciption in params
     
     #TODO: mettre Watched dans un plugin
-    default_xml = """
+    default_xml = u"""
     <params>
     <category name="Connection">
         <param name="JabberID" value="goffi@necton2.int/TestScript" type="string" />
@@ -52,7 +52,7 @@
     """
 
     def load_default_params(self):
-        self.dom = minidom.parseString(Param.default_xml)
+        self.dom = minidom.parseString(Param.default_xml.encode('utf-8'))
     
     def __init__(self, host):
         debug("Parameters init")
@@ -78,7 +78,7 @@
         """import xml in parameters, do nothing if the param already exist
         @param parent: parent class (usefull for callbacks)
         @param xml: parameters in xml form"""
-        src_dom = minidom.parseString(xml)
+        src_dom = minidom.parseString(xml.encode('utf-8'))
 
         def import_node(tgt_parent, src_parent):
             for child in src_parent.childNodes: