Re:How to Use UTF-8 with Python
by js2 on Friday December 02, 2011 @01:12PM
(#3304987)
Python supports writing Unicode literals in any encoding, but you have to declare the encoding being used. This is done by including a special comment as either the first or second line of the source file:
# -*- coding: latin-1 -*-
The syntax is inspired by Emacs’s notation for specifying variables local to a file. Emacs supports many different variables, but Python only supports ‘coding’. The dash-splat-dash symbols indicate to Emacs that the comment is special; they have no significance to Python but are a convention. Python looks for coding: name or coding=name in the comment.
http://docs.python.org/howto/unicode.html