[New-bugs-announce] [issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

Serhiy Storchaka report at bugs.python.org
Thu Jan 17 17:54:19 CET 2013


New submission from Serhiy Storchaka:

>>> import xml.etree.ElementTree
>>> data = '<?xml version="1.0" encoding="iso-8859-1"?>\n<money value="$\xa3\u20ac\U0001017b">$\xa3\u20ac\U0001017b</money>'
>>> xml.etree.ElementTree.tostring(xml.etree.ElementTree.fromstring(data), 'unicode')
'<money value="$£â\x82¬ð\x90\x85»">$£â\x82¬ð\x90\x85»</money>'

----------
components: XML
messages: 180143
nosy: eli.bendersky, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: ElementTree incorrectly parses strings with declared encoding not UTF-8
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16986>
_______________________________________


More information about the New-bugs-announce mailing list