Python Source Code Encoding

2.2. The Interpreter and Its Environment
2.2.1. Source Code Encoding
https://docs.python.org/3/tutorial/interpreter.html
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
http://legacy.python.org/dev/peps/pep-0263

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
http://stackoverflow.com/questions/701882/what-is-ansi-format

encoding123

‘\ufeffChapter’ .decode(‘utf-8-sig’)
http://stackoverflow.com/questions/17912307/u-ufeff-in-python-string

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s