diff -r ba29dcb3403f Python/pythonrun.c --- a/Python/pythonrun.c Tue Dec 20 10:13:05 2011 -0600 +++ b/Python/pythonrun.c Tue Dec 20 18:22:14 2011 +0000 @@ -780,9 +780,14 @@ if (Py_FileSystemDefaultEncoding == NULL) Py_FatalError("Py_Initialize: Unable to get the locale encoding"); - Py_HasFileSystemDefaultEncoding = 0; - interp->fscodec_initialized = 1; - return 0; + /* Use the locale encoding provided it isn't ascii */ + if (strcmp(Py_FileSystemDefaultEncoding, "ascii")) { + interp->fscodec_initialized = 1; + return 0; + } + /* Default to utf-8 for the C locale or a broken or missing locale */ + Py_FileSystemDefaultEncoding = "utf-8"; + Py_HasFileSystemDefaultEncoding = 1; } /* the encoding is mbcs, utf-8 or ascii */