Skip to content

Commit d0779a2

Browse files
committed
Support unicode text in CDATA fields by leaving the unicode strings alone
1 parent 88f3471 commit d0779a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

xmltodict.py

Lines changed: 1 addition & 2 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -73,10 +73,9 @@ def CharacterData(self, data):
73
"""SAX character data event handler"""
73
"""SAX character data event handler"""
74
if data.strip():
74
if data.strip():
75
data = data.replace("&lt;", "<")
75
data = data.replace("&lt;", "<")
76-
data = data.encode()
77
if self._inCode:
76
if self._inCode:
78
if self._mthdCode:
77
if self._mthdCode:
79-
self._mthdCode += "%s%s" % (code_linesep, data)
78+
self._mthdCode += u"%s%s" % (code_linesep, data)
80
else:
79
else:
81
self._mthdCode = data
80
self._mthdCode = data
82
else:
81
else:

0 commit comments

Comments
 (0)