Loading

Memo# Py_Unicode Object & wchar_t

Py_UNICODE

- 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,
./configure --enable-unicode=ucs4
make && make install

wchar_t

In Unix/Linux
wchar_t is unsigned long (32 bits, 4 bytes)

In Windows
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.

Cheers,

No comments:

က်ေနာ္ဖတ္ေသာ အျခား ဘေလာ့ / ဆိုဒ္မ်ား