On Wed, Oct 30, 2013 at 6:37 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
IIUC the second added line "-*- coding: utf-8 -*-\n" should not be needed,
as that's the default at the Python side anyway.
Based on the OP's experience, it seems this is not true.
Also, the doc I can find indicates that the default is ASCII (and was
latin-1 in the past, which is what the OP seems to be seeing).
There is Python, and, on the other hand, there is Python.
In some GNU/Linux distributions (e.g. Ubuntu), the default Python is
version 2.x, whose default encoding is ASCII (and has been that way
since at least 2.6).
On the other hand, the current version of Python is 3.x, where a big
Unicode revolution has happened and now the default encoding is UTF-8.
Both of these Pythons recognize Emacs-style and vim-style encoding
declarations, and in addition the UTF-8 byte order mark (which can be
called Notepad-style encoding declaration).