compile(unicode) & source encoding

Denis S. Otkidach ods at
Mon Dec 1 15:12:59 CET 2003

On 28 Nov 2003, Martin v. [iso-8859-15] LЖwis wrote:

MvL> > 1. What is the reason to encode source code to utf-8?
MvL> I think it is because Just found that the most
MvL> straight-forward thing
MvL> to do: UTF-8 supports all Unicode characters, and you have
MvL> to choose
MvL> *some* encoding, as the resulting byte strings need to be
MvL> encoded
MvL> somehow.

Why we have to choose one particular encoding and not just assume
all strings to be unicode?

MvL> In addition, anybody desiring a different encoding can
MvL> explicitly
MvL> invoke .encode()

Surely.  But there is no way to emulate "python -U" behavior for
compiled piece of code.

Denis S. Otkidach      [ru]

More information about the Python-list mailing list