This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ixokai, lemburg, loewis, pitrou, pjenvey, ronaldoussoren, vstinner
Date 2010-10-10.15:51:26
SpamBayes Score 3.084689e-08
Marked as misclassified No
Message-id <1286725888.95.0.846762557387.issue9992@psf.upfronthosting.co.za>
In-reply-to
Content
> We run into problems because we have two inconsistent
> encodings, ...

What? No. We have problems because we don't use the same encoding to decode and to encode the same data type. It's not a problem to use a different encoding for each data type (stdout, filenames, environment variables, ...).

--

About the 3rd encoding: it will be just the locale encoding. Use the locale encoding to encode/decode command line arguments and environment variables is complelty compatible with Python 3.1, because Python 3.1 initializes the filesystem encoding with the locale encoding. Use the locale encoding helps the interoperability because other programs use the same encoding.

Mac OS X is a special case. Filesystem encoding is utf-8 on this OS, whereas the locale encoding depends on LANG variable. If I understood MvL proposition correctly, we should not rely on the locale on Mac OS X. So the "3rd encoding" and the filesystem encodings should be hardcoded to utf-8?

--

The "third encoding" is no more controlable by a special environment variable, only by classic locale environment variables (LC_ALL, LC_CTYPE, LANG). Is it a problem? I remember a comment from MAL saying that it may be a problem for CGI for the environment variables because some (all?) variables are not encoded with the locale encoding (but the HTML encoding?). I don't know if Python should workaround CGI specific issues. In Python 3.2, we have now os.environb: it's now possible to use a different encoding for each variable.
History
Date User Action Args
2010-10-10 15:51:29vstinnersetrecipients: + vstinner, lemburg, loewis, ixokai, ronaldoussoren, pitrou, pjenvey
2010-10-10 15:51:28vstinnersetmessageid: <1286725888.95.0.846762557387.issue9992@psf.upfronthosting.co.za>
2010-10-10 15:51:27vstinnerlinkissue9992 messages
2010-10-10 15:51:26vstinnercreate