Issue #9642: Fix filesystem encoding initialization: use the ANSI code page on

Windows if the mbcs codec is not available, and fail with a fatal error if we
cannot get the locale encoding (if nl_langinfo(CODESET) is not available)
instead of using UTF-8.
This commit is contained in:
Victor Stinner 2011-07-04 13:48:30 +02:00
parent c5ee7f213e
commit d64e8a75e5
3 changed files with 20 additions and 18 deletions

View file

@ -24,12 +24,9 @@ int Py_HasFileSystemDefaultEncoding = 1;
#elif defined(__APPLE__)
const char *Py_FileSystemDefaultEncoding = "utf-8";
int Py_HasFileSystemDefaultEncoding = 1;
#elif defined(HAVE_LANGINFO_H) && defined(CODESET)
#else
const char *Py_FileSystemDefaultEncoding = NULL; /* set by initfsencoding() */
int Py_HasFileSystemDefaultEncoding = 0;
#else
const char *Py_FileSystemDefaultEncoding = "utf-8";
int Py_HasFileSystemDefaultEncoding = 1;
#endif
static PyObject *