Skip to content

Instantly share code, notes, and snippets.

@mgax
Created July 14, 2013 18:10
Show Gist options
  • Save mgax/f6a3edc5b4883b3377e8 to your computer and use it in GitHub Desktop.
Save mgax/f6a3edc5b4883b3377e8 to your computer and use it in GitHub Desktop.
>>> from lxml.etree import fromstring
>>> fromstring('<s/>')
<Element s at 0x10cc34050>
>>> fromstring('<ș/>')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0219' in position 9: ordinal not in range(128)
>>> fromstring(u'<ș/>')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0219' in position 9: ordinal not in range(128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment