[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

Marc-Andre Lemburg report at bugs.python.org
Fri Oct 1 14:46:54 CEST 2010


Marc-Andre Lemburg <mal at egenix.com> added the comment:

STINNER Victor wrote:
> 
> STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> 
> I don't know how to test "if Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2". On Windows, sizeof(wchar_t) is 2, but it looks like Python is not prepared to have Py_UNICODE != wchar_t for is Windows implementation.
>
> wchar_t is 32 bits long on Linux and Mac OS X. So how can I test it? Or should we just drop support of "Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2"?

You can tweak the Windows pyconfig.h to use UCS4, AFAIK, if you want to
test drive this case.

But it's probably easier to configure with "gcc -fshort-wchar" on
Linux :-)

Dropping support for this is not a good idea.

----------
title: c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE) -> c_types.c_wchar should not assume that sizeof(wchar_t) ==	sizeof(Py_UNICODE)

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8670>
_______________________________________


More information about the Python-bugs-list mailing list