Updated XEP-0009 to handle unicode strings

This commit is contained in:
Correl Roush
2012-02-17 12:24:44 -05:00
parent 79f1aa0e1b
commit 31d3e3b2b6
2 changed files with 21 additions and 1 deletions

View File

@@ -54,7 +54,7 @@ def _py2xml(*args):
boolean = ET.Element("{%s}boolean" % _namespace)
boolean.text = str(int(x))
val.append(boolean)
elif type(x) is str:
elif type(x) in (str, unicode):
string = ET.Element("{%s}string" % _namespace)
string.text = x
val.append(string)