File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.2 Beta 1?
1010Core and Builtins
1111-----------------
1212
13+ - Issue #9992: On Mac OS X, decode command line arguments from utf-8 instead of
14+ the locale encoding.
15+
1316- Issue #9992: Remove PYTHONFSENCODING environment variable.
1417
1518Library
Original file line number Diff line number Diff line change @@ -41,7 +41,15 @@ main(int argc, char **argv)
4141 oldloc = strdup (setlocale (LC_ALL , NULL ));
4242 setlocale (LC_ALL , "" );
4343 for (i = 0 ; i < argc ; i ++ ) {
44- argv_copy2 [i ] = argv_copy [i ] = _Py_char2wchar (argv [i ]);
44+ #ifdef __APPLE__
45+ /* Use utf-8 on Mac OS X */
46+ PyObject * unicode = PyUnicode_FromString (argv [i ]);
47+ argv_copy [i ] = PyUnicode_AsWideCharString (unicode , NULL );
48+ Py_DECREF (unicode );
49+ #else
50+ argv_copy [i ] = _Py_char2wchar (argv [i ]);
51+ #endif
52+ argv_copy2 [i ] = argv_copy [i ];
4553 if (!argv_copy [i ])
4654 return 1 ;
4755 }
You can’t perform that action at this time.
0 commit comments