--- a/xmlclass/xmlclass.py Thu May 24 18:45:16 2012 +0200
+++ b/xmlclass/xmlclass.py Tue May 29 17:11:37 2012 +0200
@@ -126,13 +126,13 @@
if not extract:
return attr
if len(attr.childNodes) == 1:
- return unescape(attr.childNodes[0].data.encode("utf-8"))
+ return unicode(unescape(attr.childNodes[0].data))
else:
# content is a CDATA
- text = ""
+ text = u''
for node in attr.childNodes:
- if not (node.nodeName == "#text" and node.data.strip() == ""):
- text += unescape(node.data.encode("utf-8"))
+ if not (node.nodeName == "#text" and node.data.strip() == u''):
+ text += unicode(unescape(node.data))
return text
@@ -535,7 +535,7 @@
def GenerateAnyInfos(infos):
def ExtractAny(tree):
if tree.nodeName in ["#text", "#cdata-section"]:
- return unescape(tree.data.encode("utf-8"))
+ return unicode(unescape(tree.data))
else:
return tree