summaryrefslogtreecommitdiff
path: root/src/lxml
diff options
context:
space:
mode:
authorscoder <none@none>2008-05-24 10:10:09 +0200
committerscoder <none@none>2008-05-24 10:10:09 +0200
commitdfeffb35598dfe3a38b4f10444fe514947beea90 (patch)
treeec802e1dc67f2999623865a43aefaf25b1764f53 /src/lxml
parent8e28f713c2a429e71bfdf1d4a28cd31449da788f (diff)
downloadpython-lxml-dfeffb35598dfe3a38b4f10444fe514947beea90.tar.gz
[svn r3742] r4337@delle: sbehnel | 2008-05-24 10:04:51 +0200
unicode fix --HG-- branch : trunk
Diffstat (limited to 'src/lxml')
-rw-r--r--src/lxml/saxparser.pxi10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lxml/saxparser.pxi b/src/lxml/saxparser.pxi
index 1eb7464f..1150e441 100644
--- a/src/lxml/saxparser.pxi
+++ b/src/lxml/saxparser.pxi
@@ -144,7 +144,10 @@ cdef void _handleSaxStart(void* ctxt, char* c_localname, char* c_prefix,
name = _namespacedNameFromNsName(
c_attributes[2], c_attributes[0])
if c_attributes[3] is NULL:
- value = ""
+ if python.IS_PYTHON3:
+ value = u''
+ else:
+ value = ''
else:
value = python.PyUnicode_DecodeUTF8(
c_attributes[3], c_attributes[4] - c_attributes[3],
@@ -192,7 +195,10 @@ cdef void _handleSaxStartNoNs(void* ctxt, char* c_name,
while c_attributes[0] is not NULL:
name = funicode(c_attributes[0])
if c_attributes[1] is NULL:
- value = ""
+ if python.IS_PYTHON3:
+ value = u''
+ else:
+ value = ''
else:
value = funicode(c_attributes[1])
c_attributes = c_attributes + 2