[Python-Dev] EuroPython Language Summit report

Terry Reedy tjreedy at udel.edu
Fri Jun 24 22:30:06 CEST 2011

On 6/24/2011 7:18 AM, Victor Stinner wrote:
> Le vendredi 24 juin 2011 à 10:52 +0200, Mark Dickinson a écrit :
>>    One  example: when opening a text file for reading and writing, the default
>>      encoding used depends on the platform and on various environment variables.
> ... oh, I agree. This choice is a big portability issue. Mac OS X, most
> Linux distro, BSD systems use UTF-8 local encoding, whereas Windows use
> legacy code pages like cp1252 (something like ISO-8859-1) or cp952
> (shift jis). But sometimes, the locale is "C" (e.g. on our buildbots)
> and programs start to fail with Unicode errors...
> I see two options to improve the situation.

The third is to make utf-8 the default. I believe this *is* the proper 
long term solution and both options are contrary to this.
I believe that this is what I want for myself even on Windows.
I believe utf-8 is the default or only storage by cross-platform
international programs (certainly the ones I use).

> (1) hard way: change open() API to make encoding a mandatory argument.

> (2) soft way: add a warning if the encoding is implicit (locale
> encoding).

(3) In 3.3, if the default is used and it is not utf-8, add a warning 
that the default will become utf-8 always in 3.4. Actually, I would like 
a PendingDeprecationWarning in 3.2.1 if possible.

Terry Jan Reedy

More information about the Python-Dev mailing list