对于我的debian9中的unicode版本
ls /usr/share/doc/unicode-data
changelog.Debian.gz copyright提取changelog.Debian.gz,一些版本信息,如下:
unicode-data (9.0-1) unstable; urgency=medium
* New upstream release. Closes: #827098.
* Move to Standards-Version: 3.9.6. No changes required.
-- Alastair McKinstry <mckinstry@debian.org> Wed, 22 Jun 2016 14:49:26 +0100
unicode-data (8.0-3) unstable; urgency=medium
* Fetch new allkeys.txt for Unicode 8. Closes: #809188.
* Move to S-V: 3.9.6. No changes required.
* Fix sort error in NameAliases.txt. Closes: #808465.
-- Alastair McKinstry <mckinstry@debian.org> Tue, 29 Dec 2015 02:15:32 +0000我的debian9的unicode版本是9.0-1?
对于python3中的unicode版本
>>> import unicodedata
>>> unicodedata.unidata_version
'8.0.0'是否表示我的debian9中的unicode版本是9.0-1,与我的python3中的unicode版本不同?
发布于 2018-06-06 17:25:11
Python不使用系统unicodedata。它是在现有的集合上编译的。如果你检查下面的url
https://docs.python.org/3.5/library/unicodedata.html
此模块提供对Unicode字符数据库(UCD)的访问,该数据库定义所有Unicode字符的字符属性。此数据库中包含的数据从UCD版本8.0.0编译而来。
而对于Python 3.6.5
https://docs.python.org/3.6/library/unicodedata.html
此模块提供对Unicode字符数据库(UCD)的访问,该数据库定义所有Unicode字符的字符属性。此数据库中包含的数据从UCD版本9.0.0编译而来。
所以这仅仅是因为您的系统python版本不在3.6.X上,这就是您看到8.0.0的原因
发布于 2018-04-19 19:07:22
Python附带了对unicodedata的内置支持。
例如,我的/usr/share/doc/python3.6/changelog.gz (运行Debian/sid,所以Python3.6.5-3)说:
3.6.0beta 2中的新特性?... -将内部unicode数据库升级到Unicode版本9.0.0。
因此,它很可能会忽略您在系统上安装的任何内容(例如,通过unicode-data)。
https://stackoverflow.com/questions/49911831
复制相似问题