mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #8965: initfsencoding() doesn't change the encoding on Mac OS X
File system encoding have to be hardcoded to "utf-8" on Mac OS X. r81190 introduced a regression: the encoding was changed depending on the locale.
This commit is contained in:
parent
2b293cf1a5
commit
7f84ab5952
1 changed files with 19 additions and 17 deletions
|
@ -703,6 +703,7 @@ initfsencoding(void)
|
|||
#if defined(HAVE_LANGINFO_H) && defined(CODESET)
|
||||
char *codeset;
|
||||
|
||||
if (Py_FileSystemDefaultEncoding == NULL) {
|
||||
/* On Unix, set the file system encoding according to the
|
||||
user's preference, if the CODESET names a well-known
|
||||
Python codec, and Py_FileSystemDefaultEncoding isn't
|
||||
|
@ -721,6 +722,7 @@ initfsencoding(void)
|
|||
"fallback to utf-8\n");
|
||||
Py_FileSystemDefaultEncoding = "utf-8";
|
||||
Py_HasFileSystemDefaultEncoding = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* the encoding is mbcs, utf-8 or ascii */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue