diff tools/memory.py @ 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
parents bb72c29f3432
children 3e24753b9e0b
line wrap: on
line diff
--- 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: