STINNER Victor <victor.stin...@haypocalc.com> added the comment: > > ... So Antoine and Martin: which encoding do you prefer? > > I still propose to drop the fsname encoding. Then this question goes away.
You mean that we should use the following encoding for the command line arguments, environment variables and all filenames/paths: - Mac OS X: utf-8 - Windows: unicode for command line/env, mbcs to decode filenames - others OSes: locale encoding To do that, we have to: - "others OSes": delete the PYTHONFSENCODING variable - Mac OS X: use utf-8 to decode the command line arguments (we can use PyUnicode_DecodeUTF8()+PyUnicode_AsWideCharString() before Python is initialized) On "others OSes", we continue to use the FS encoding to encode command line/env vars, because the FS encoding will always be the locale encoding. And it's more pratical to use sys.getfilesystemencoding() than mbstowcs(), wcstombs(), _Py_wchar2char(), _Py_char2wchar(), etc. because the FS encoding doesn't depend on the current locale, and it uses Python codecs which support more error handlers. I like this solution because it doesn't change a lot of things. I agree to drop PYTHONFSENCODING because it looks like PYTHONFSENCODING introduced more inconsistencies than it solved. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9992> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com