Sign In/My Account | View Cart  
advertisement

Article:
 More Unicode Secrets
Subject: Checking whether you have a UCS4 Python build
Date: 2005-06-26 06:19:09
From: Uche Ogbuji

As I say in the article: "if possible, use a Python install compiled to use UCS4 character storage." Micah Dubinko asked how to check whether your current Python build is such. The best test right now is to take advantage of one of the bugs present in UCS2 builds and not UCS4 builds. The test that Eric van der Vlist came up with, for example:


if len(u'\U00010800') == 1:
print "UCS4"
else: #len is 2 in UCS2 builds
print "UCS2"



No Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Oldest First

Sponsored By: