Index: Python/bltinmodule.c =================================================================== --- Python/bltinmodule.c (révision 84199) +++ Python/bltinmodule.c (copie de travail) @@ -19,7 +19,7 @@ Don't forget to modify PyUnicode_DecodeFSDefault() if you touch any of the values for Py_FileSystemDefaultEncoding! */ -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) const char *Py_FileSystemDefaultEncoding = "mbcs"; int Py_HasFileSystemDefaultEncoding = 1; #elif defined(__APPLE__) Index: Include/unicodeobject.h =================================================================== --- Include/unicodeobject.h (révision 84199) +++ Include/unicodeobject.h (copie de travail) @@ -1143,13 +1143,13 @@ const char *errors /* error handling */ ); -#ifdef MS_WIN32 +#if defined(MS_WINDOWS) /* --- MBCS codecs for Windows -------------------------------------------- */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS( const char *string, /* MBCS encoded string */ - Py_ssize_t length, /* size of string */ + Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); @@ -1170,7 +1170,7 @@ const char *errors /* error handling */ ); -#endif /* MS_WIN32 */ +#endif /* MS_WINDOWS */ /* --- Decimal Encoder ---------------------------------------------------- */ Index: Objects/unicodeobject.c =================================================================== --- Objects/unicodeobject.c (révision 84199) +++ Objects/unicodeobject.c (copie de travail) @@ -1335,7 +1335,7 @@ else if ((strcmp(lower, "latin-1") == 0) || (strcmp(lower, "iso-8859-1") == 0)) return PyUnicode_DecodeLatin1(s, size, errors); -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) else if (strcmp(lower, "mbcs") == 0) return PyUnicode_DecodeMBCS(s, size, errors); #endif @@ -1469,7 +1469,7 @@ PyObject *PyUnicode_EncodeFSDefault(PyObject *unicode) { if (Py_FileSystemDefaultEncoding) { -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) if (strcmp(Py_FileSystemDefaultEncoding, "mbcs") == 0) return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), @@ -1510,7 +1510,7 @@ return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), errors); -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) else if (strcmp(lower, "mbcs") == 0) return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), @@ -1634,7 +1634,7 @@ bootstrapping process where the codecs aren't ready yet. */ if (Py_FileSystemDefaultEncoding) { -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) if (strcmp(Py_FileSystemDefaultEncoding, "mbcs") == 0) { return PyUnicode_DecodeMBCS(s, size, NULL); } @@ -4570,7 +4570,7 @@ NULL); } -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) /* --- MBCS codecs for Windows -------------------------------------------- */ Index: Modules/_codecsmodule.c =================================================================== --- Modules/_codecsmodule.c (révision 84199) +++ Modules/_codecsmodule.c (copie de travail) @@ -588,7 +588,7 @@ return codec_tuple(unicode, pbuf.len); } -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) static PyObject * mbcs_decode(PyObject *self, @@ -989,7 +989,7 @@ return PyUnicode_BuildEncodingMap(map); } -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) static PyObject * mbcs_encode(PyObject *self, @@ -1101,7 +1101,7 @@ {"charmap_decode", charmap_decode, METH_VARARGS}, {"charmap_build", charmap_build, METH_VARARGS}, {"readbuffer_encode", readbuffer_encode, METH_VARARGS}, -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#if defined(MS_WINDOWS) {"mbcs_encode", mbcs_encode, METH_VARARGS}, {"mbcs_decode", mbcs_decode, METH_VARARGS}, #endif Index: Modules/main.c =================================================================== --- Modules/main.c (révision 84203) +++ Modules/main.c (copie de travail) @@ -99,7 +99,7 @@ " The default module search path uses %s.\n" "PYTHONCASEOK : ignore case in 'import' statements (Windows).\n" "PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n" -#if !(defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)) && !defined(__APPLE__) +#if !defined(MS_WINDOWS) && !defined(__APPLE__) "PYTHONFSENCODING: Encoding used for the filesystem.\n" #endif ;