use proper utf-8 encoding for parsing xml in parameters
This commit is contained in:
parent
a5c34eeec9
commit
f45ae91d41
2 changed files with 4 additions and 4 deletions
|
|
@ -57,7 +57,7 @@ class Param(wx.Frame):
|
|||
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")
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class Param():
|
|||
### 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 @@ class Param():
|
|||
"""
|
||||
|
||||
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 @@ class Param():
|
|||
"""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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue