Tuesday, September 17, 2013

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128)


http://stackoverflow.com/questions/3224268/python-unicode-encode-error

Likely, the problem is that you parsed it okay, and now you're trying to print the contents of the XML and you can't because theres some foreign Unicode characters. Try to encode your unicode string as ascii first:
unicodeData.encode('ascii', 'ignore')

No comments: