Authoritative Source: http://www.python.org/dev/peps/pep-0263/
The header declaration of the Python source file (declared on the first or second line of the file)
# Coding=utf-8
# Coding:utf-8
#-*-Coding:utf-8-*-
To conform to the regular specification "coding[:=]\s* ([-\w.] +) "NOTE: or = no spaces before and after
Defining the Encoding
Python would default to ASCII as standard encoding if no other encoding hints is given. To define a source code encoding, a magic comment must is placed into the source files either as first or second l Ine in the file, such as: # coding=<encoding name> or (using formats recognized by popular editors) #!/u Sr/bin/python #-*-Coding: <encoding name>-*- or #!/usr/bin/python # vim:set fileencoding= <encoding name>: More precisely, the first or second line must match the regular expression "coding[:=]\s * ([-\w.] +)". The first group of this expression was then interpreted as encoding name. If the encoding is unknown to Python, an error is raised during compilation. There must not being any Python statement on the line that contains the encoding declaration.
The full name of the PEP is the Python enhancement proposals, "Python enhancement Advice", which is a specification of each of the various enhancements and extensions that define Python.
Each pep has a number and is unique, and this number will not change once it is fixed, for example, Pep 3000 is used to define the relevant specifications for Python 3.0, and Pep 333 is the Python Web application Interface WSGI (Web Serve R Gateway Interface 1.0) Specifications
The relative specification of THE PEP itself is the definition in Pep 1, and all pep lists are here
Read More:http://www.arthurtoday.com/2009/11/python-pep.html#ixzz46oh9obzv
Learning: http://blog.csdn.net/orangleliu/article/details/8755461
Python File Encoding Description coding