- Py_UNICODE is a typedef alias for either unsigned short (UCS2) or unsigned long (UCS4).
- UCS2 and UCS4 Python builds are not binary compatible.
To compile Python with UCS4,
make && make install
wchar_t is unsigned long (32 bits, 4 bytes)
wchar_t is unsigned short (16 bits, 2 bytes)
If you use wchar_t C/C++ in codes and when need to convert to Py_Unicode, your python need to be UCS4 binary.
Pls share and like this post
17 hours ago