[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 15:06:05 CEST 2010
Marc-Andre Lemburg <mal at egenix.com> added the comment:
Daniel Stutzbach wrote:
>
> Daniel Stutzbach <daniel at stutzbachenterprises.com> added the comment:
>
>> You can tweak the Windows pyconfig.h to use UCS4, AFAIK, if you want to
>> test drive this case.
>
> I seem to recall seeing some other code that assumed Windows implied UCS2. Proceed with caution. ;-)
Probably, yes. I've never tried it myself.
>> But it's probably easier to configure with "gcc -fshort-wchar" on
>> Linux :-)
>
> libc will still be using sizeof(wchar_t) == 4, though. Won't that cause Bad Things to happen when calling libc wide-character functions?
Sure, but this is just about testing an interface, not running
applications :-)
Here's what the GCC man-page has to say:
-fshort-wchar
Override the underlying type for wchar_t to be short unsigned int instead
of the default for the target. This option is useful for building
programs to run under WINE.
Warning: the -fshort-wchar switch causes GCC to generate code that is not
binary compatible with code generated without that switch. Use it to
conform to a non-default application binary interface.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8670>
_______________________________________
More information about the Python-bugs-list
mailing list