Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

It's actually very easy:

Py_UNICODE is a 2-byte value for UCS-2 builds and 4 byte value for UCS-4
builds of Python.

print ((sys.maxunicode < 66000) and 'UCS2' or 'UCS4')

tells you which one you have.

Note that you should *not* use the exact value of 0x10FFFF for UCS-4 -
it's possible that the Unicode consortium decides to add more planes to
the Universal Character Set... (though not likely).

The above comparison is good enough to detect the number of bytes in a
single code point, though.

----------
nosy: +lemburg

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3098>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to