I’m writing python code on eclipse and whenver I use hebrew characters I get the following syntax error:
SyntaxError: Non-ASCII character ‘\xfa’ in file … on line 66, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
How do I declare unicode/utf-8 encoding?
I tried adding
-*- coding: Unicode -*-
or
-*- coding: utf-8 -*-
in the commented section in the beginnning of the py file. It didn’t work.
I’m running eclipse with pydev, python 2.6 on windows 7.
I had the same thing and it was because I’d tried to do:
When I should have done:
I think it’s python/pydev complaining when trying to parse the source, rather than eclipse as such.