Skip to content

Instantly share code, notes, and snippets.

@k0001
Created May 10, 2009 06:40
Show Gist options
  • Save k0001/109522 to your computer and use it in GitHub Desktop.
Save k0001/109522 to your computer and use it in GitHub Desktop.
In [19]: import xml.etree.ElementTree as ET
In [20]: x = u'<hello id="ŁðÆŊЧ"><world /></hello>'
In [21]: ET.tostring(ET.fromstring(x.encode('utf-8')), encoding='utf-8').decode('utf-8') == x
Out[21]: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment