mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
object to Py_FileSystemDefaultEncoding with the "surrogateescape" error handler, return a bytes object. If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
This commit is contained in:
parent
59e62db0a3
commit
ae6265f8d0
10 changed files with 46 additions and 26 deletions
|
|
@ -3147,9 +3147,7 @@ PyInit__tkinter(void)
|
|||
it also helps Tcl find its encodings. */
|
||||
uexe = PyUnicode_FromWideChar(Py_GetProgramName(), -1);
|
||||
if (uexe) {
|
||||
cexe = PyUnicode_AsEncodedString(uexe,
|
||||
Py_FileSystemDefaultEncoding,
|
||||
NULL);
|
||||
cexe = PyUnicode_EncodeFSDefault(uexe);
|
||||
if (cexe)
|
||||
Tcl_FindExecutable(PyBytes_AsString(cexe));
|
||||
Py_XDECREF(cexe);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue