This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients amaury.forgeotdarc, benjamin.peterson, georg.brandl, lemburg, pitrou, schuppenies
Date 2008-06-13.19:51:40
SpamBayes Score 0.0322338
Marked as misclassified No
Message-id <1213386702.14.0.033840851849.issue3098@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-06-13 19:51:42lemburgsetspambayes_score: 0.0322338 -> 0.0322338
recipients: + lemburg, georg.brandl, amaury.forgeotdarc, pitrou, benjamin.peterson, schuppenies
2008-06-13 19:51:42lemburgsetspambayes_score: 0.0322338 -> 0.0322338
messageid: <1213386702.14.0.033840851849.issue3098@psf.upfronthosting.co.za>
2008-06-13 19:51:41lemburglinkissue3098 messages
2008-06-13 19:51:40lemburgcreate