Saturday, December 15, 2012

python自动字符集检测chardet


chardet下载地址:http://chardet.feedparser.org/
也可以使用pip安装:pip install chardet

测试:


In [1]: import chardet

In [2]: a = "我"

In [3]: chardet.detect(a)
Out[3]: {'confidence': 0.505, 'encoding': 'utf-8'}

No comments:

Post a Comment