[I18n-sig] UCS-4 configuration

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Wed, 27 Jun 2001 19:21:26 +0200


> + Windows _winreg doesn't link.  Unclear (to me) what assumptions
>   it really needs to have met; it's failing now because
>   HAVE_USABLE_WCHAR_T isn't #define'd anymore, but I don't know
>   really know what "usable" refers to (perhaps that it's usable
>   by _winreg <wink>).

HAVE_USABLE_WCHAR_T should be defined iff
sizeof(wchar_t)==sizeof(Py_UNICODE) (*). If you follow my proposal,
PC/config.h should define this simultaneously with defining
Py_UNICODE_TYPE to wchar_t.

OTOH, the implementation of PyUnicode_DecodeMBCS and friends should
probably be changed to operate for a wide Py_UNICODE also. Currently,
it calls MultiByteToWideChar; this should be followed by widening each
value if a wide Py_UNICODE is used. Without such a change, the "mbcs"
codec won't work on Windows with a wide Py_UNICODE.

Regards,
Martin

(*) technically, this requires also that wchar_t values are always
understood as Unicode in the C library, instead of, say, EUC-JP. This
is hard to test in general, but for Windows, it is known to be true.