[Python-Dev] PEP 263 - default encoding (original) (raw)

Martin v. Loewis martin@v.loewis.de
16 Mar 2002 10:10:56 +0100


Guido van Rossum <guido@python.org> writes:

But the treatment of k under phase 2 will be, um, interesting, and I'm not sure what it should do!!! Since in phase 2 the entire file will be decoded from KOI8-R to Unicode before it's parsed, maybe the best thing would be to encode 8-bit string literals back using KOI8-R (in general, the encoding given in the encoding cookie).

The meaning of the string literals will not change: they continue to denote byte strings, and they continue to denote the same byte strings that they denote today (by accident).

What will change is this:

In general, the implementation strategy will be indeed that strings literals are encoded back into their original encoding. It is not clear to me when this should happen, though; in particular, whether the AST should have Py_UNICODE* everywhere.

Regards, Martin