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
Good catch, we're definitely missing tests for unicode handling. To fix this, I think it would be best to create a failing test here for the issue, and then we will probably have to fix the unicode handling when reading XML data from a file in parse_from_file(). Most likely, it will probably be best to just use the ElementTree.parse function to read the file data and let ElementTree handle unicode for us.
I can probably get to this within the next week or two and push out a new release to PyPi, but if you are able to open a pull request with the fix, that would be great as well!
Ohh alright, trust ET.parse to pick up the right encoding from the XML header, right? And fallback to utf-8 if missing, I assume. I made a few fast modifications, I need some results for a project I'm working on (the urgent never leaves time for the important, right?), so I ended up adding the encoding as an optional parameter. Nevertheless, I would leave something like this as an option too, in case of a wrongly formatted XML.
First time dealing with the infamous Unicode pain. Hopefully the last one!
Under python2, using non ASCII characters raises UnicodeEncodeError.
How would you like this to be addressed?
The text was updated successfully, but these errors were encountered: