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 _______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
