正如标题所说。
$ ./configure --help | grep -i ucs
--enable-unicode[=ucs[24]]
在搜索官方文档时,我发现:
sys.maxunicode: An integer giving the largest supported code point for a Unicode character. The value of this depends on the configuration option that specifies whether Unicode characters are stored as UCS-2 or UCS-4.
这里不清楚的是-哪个值对应于UCS-2和UCS-4。
这段代码有望在Python2.6+上运行。
我也有过同样的问题。我把它记录在我的维基上
http://arcoleo.org/dsawiki/Wiki.jsp?page=Python%20UTF%20-%20UCS2%20or%20UCS4
我写了-
对于UCS-2是0xFFFF(或65535),对于UCS-4是0x10FFFF(或1114111):
UCS-4模式中的最大字符由UTF-16中表示的最大值定义。
当使用--enable unicode=ucs4构建时:
当使用--enable unicode=ucs2构建时:
相关问题 更多 >
编程相关推荐