Skip to content

Commit

Permalink
Support unicode text in CDATA fields by leaving the unicode strings a…
Browse files Browse the repository at this point in the history
…lone
  • Loading branch information
rcoup committed Dec 22, 2010
1 parent 88f3471 commit d0779a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xmltodict.py
Expand Up @@ -73,10 +73,9 @@ def CharacterData(self, data):
"""SAX character data event handler""" """SAX character data event handler"""
if data.strip(): if data.strip():
data = data.replace("&lt;", "<") data = data.replace("&lt;", "<")
data = data.encode()
if self._inCode: if self._inCode:
if self._mthdCode: if self._mthdCode:
self._mthdCode += "%s%s" % (code_linesep, data) self._mthdCode += u"%s%s" % (code_linesep, data)
else: else:
self._mthdCode = data self._mthdCode = data
else: else:
Expand Down

0 comments on commit d0779a2

Please sign in to comment.