SyntaxError of Non-ASCII character [duplicate]
This question already has an answer here: Correct way to define Python source code encoding 6 answers SyntaxError: Non-ASCII character '\xa3' in file when function returns '£' 4 answers I am trying to parse xml which contains the some non ASCII cheracter, the code looks like below from lxml import etree from lxml import objectify content = u'<?xml version="1.0" encoding="utf-8"?><div>Order date : 05/08/2013 12:24:28</div>' mail.replace('\xa0',' ') xml = etree.fromstring(mail) but it shows me error on the line 'content = ...' like syntaxError: Non-ASCII character '\xc2' in file /home/projects