Alec Taylor writes: > Hmm, nothing mentioned so far works for me... > > Here's a very small test case: > > >>> python -u "Convert to Creole.py" > File "Convert to Creole.py", line 1 > SyntaxError: Non-ASCII character '\xe2' in file Convert to Creole.py > on line 1, but no encoding declared; see > http://www.python.org/peps/pep-0263.html for details > >>> Exit Code: 1 > > Line 1: a=u'''≤'''.encode("ascii", "ignore").decode("ascii")
The people who told you to declare the source code encoding in the source file would like to see Line 0. See <http://www.python.org/peps/pep-0263.html>. [1001] ruuvi$ cat ctc.py # coding=utf-8 print u'''x ≤ 1'''.encode("ascii", "ignore").decode("ascii") [1002] ruuvi$ python ctc.py x 1 [1003] ruuvi$ -- http://mail.python.org/mailman/listinfo/python-list