[issue9642] #ifdef and mbcs: don't check for defined(HAVE_USABLE_WCHAR_T)

STINNER Victor report at bugs.python.org
Wed Jun 22 23:14:56 CEST 2011

STINNER Victor <victor.stinner at haypocalc.com> added the comment:

have_mbcs.patch: use HAVE_MBCS define instead of different tests to check if the MBCS codec can be used or not. HAVE_MBCS is defined in unicodeobject.h by:

#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
#  define HAVE_MBCS

> > We should just check that we are compiling under Windows:

> -1, see above. In the long run, it would be really good if Python
> supported a four-byte Py_UNICODE on Windows - people keep asking
> for it.

MBCS functions of the Python API are always available on Windows without my patch. I don't know if it's correct or not. Using my patch, they are not available if HAVE_USABLE_WCHAR_T is not defined.

Support 32 bits Py_UNICODE on Windows requires a lot of work because in *many* places (everywhere?) Py_UNICODE* is used as wchar_t*. But it is not the topic of this issue :-)

Added file: http://bugs.python.org/file22424/have_mbcs.patch

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list