Python Source Code Encoding

2.2. The Interpreter and Its Environment
2.2.1. Source Code Encoding
By default, Python source files are treated as encoded in UTF-8.
In that encoding, characters of most languages in the world can be used simultaneously in string literals, identifiers and comments — although the standard library only uses ASCII characters for identifiers, a convention that any portable code should follow.

PEP 0263 — Defining Python Source Code Encodings

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

The default encoding was set to “ascii” in version 2.5.

ANSI format


‘\ufeffChapter’ .decode(‘utf-8-sig’)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s