You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Py30a3] xml.parsers.expat recognizes encoding="utf-8" but not encoding="utf8" #46531
Should the parser recognize "utf8"? I looked at the XML standard [1] and
it referred me to the IANA's charts [2]. It appears the the only correct
way to denote UTF-8 is "UTF-8".
You're right that the parser should not recognise "utf8" since it isn't
correct XML (as per the references you gave).
I made the mistake because I used the etree module and wrote an XML file
with encoding "utf8" which etree accepted. I've now switched to using
"UTF-8".
Activity
mark-summerfield commentedon Mar 12, 2008
Here is how to reproduce the bug:
benjaminp commentedon Mar 13, 2008
Should the parser recognize "utf8"? I looked at the XML standard [1] and
it referred me to the IANA's charts [2]. It appears the the only correct
way to denote UTF-8 is "UTF-8".
[1] http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
[2] http://www.iana.org/assignments/character-sets
mark-summerfield commentedon Mar 15, 2008
You're right that the parser should not recognise "utf8" since it isn't
correct XML (as per the references you gave).
I made the mistake because I used the etree module and wrote an XML file
with encoding "utf8" which etree accepted. I've now switched to using
"UTF-8".
birkenfeld commentedon Mar 17, 2008
Okay to close this, then?