PEP: Defining Python Source Code Encodings

Neil Hodgson nhodgson at bigpond.net.au
Sun Aug 12 18:45:40 EDT 2001


Ian Parker:

> 3)  if I were to be cutting and pasting chunks of code from different
> source files, would things get somewhat confused if the encodings are
> different?

   Depends on the editor and the encodings. I'd expect the way this would
work is for the editor to work in Unicode internally and to use a Unicode
based clipboard format as well as others for communication with non-Unicode
editors. Encoded Python code is transformed into Unicode when loading and
transformed back into the stated encoding on save.

   There should also be sensible errors when there is an attempt to insert
characters into the editor which can not be saved in the current encoding.

   Neil






More information about the Python-list mailing list