[Python-3000] Unicode and OS strings
Guido van Rossum
guido at python.org
Tue Sep 18 17:11:41 CEST 2007
On 9/17/07, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Note that some people are currently arguing that sys.argv should be an
> array of bytes objects, and Guido has not yet said "no".
Then let me say "no" now. I'd be happy to support a lower-level API
for getting at the actual bytes in the C-level argv and env (even
taking into account modifications to these made by C code out of our
control; and in Windows we should provide access to the command line
text as well). But argv and environ should be strings. If they contain
non-ASCII bytes I am currently in favor os doing a best-effort
decoding using the default locale encoding, replacing errors with '?'
rather than throwing exception.
Others have already explained why (they are typically text entered by a user).
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000