[New-bugs-announce] [issue8775] Use locale encoding to decode sys.argv, not the file system encoding

"Martin v. Löwis" martin at v.loewis.de
Thu May 20 19:23:02 CEST 2010


> I think that we should use the locale encoding to encode and decode command line arguments. 

I disagree. IIUC, this is only about OSX. Now, we shouldn't take any
action until either some OSX expert explains us how command line
arguments are being passed on OSX, or we find some Apple documentation
that can be taken as a specification.

I think the C locale is very poorly supported on OSX, and we shouldn't
really use it for anything. What may be useful is the terminal encoding
(which may be different both from UTF-8 and the locale encoding),
however, it's not possible to find out what the terminal encoding is.
In addition, programs may be started "directly" (i.e. not from the
terminal), in which case the terminal encoding would be irrelevant.

For file name arguments at least, it's very clear that the command line
arguments also use the file system encoding.




More information about the New-bugs-announce mailing list