Skip to content

Instantly share code, notes, and snippets.

@chenko515
Created September 10, 2013 10:29
Show Gist options
  • Save chenko515/6507591 to your computer and use it in GitHub Desktop.
Save chenko515/6507591 to your computer and use it in GitHub Desktop.

Revisions

  1. chenko515 created this gist Sep 10, 2013.
    21 changes: 21 additions & 0 deletions PythonSourceEncoding
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    http://www.python.org/dev/peps/pep-0263/

    Defining the Encoding
    Python will default to ASCII as standard encoding if no other
    encoding hints are given.

    To define a source code encoding, a magic comment must
    be placed into the source files either as first or second
    line in the file, such as:

    # coding=<encoding name>

    or (using formats recognized by popular editors)

    #!/usr/bin/python
    # -*- coding: <encoding name> -*-

    or

    #!/usr/bin/python
    # vim: set fileencoding=<encoding name> :