I have trouble with Emacs+Python 2.7.1+Encoding. According to PEP 0263, Python uses the same declaration of source encoding as emacs does.
There is no problem when I start my Python source code script with the following encoding tag:
#!/usr/bin/python
# -*- mode=python; encoding:us-ascii -*-
But when I add a line ending mode to my encoding such as in:
#!/usr/bin/python
# -*- mode=python; encoding:us-ascii-unix -*-
Emacs still acepts my encoding information, but I get the following error from Python when executing my script:
File "./unicode.py", line 2
SyntaxError: encoding problem: with BOM
Is there a way to tell Emacs about the line ending I want to use and at the same time tell Python about the source file encoding?