您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

python判断字符串编码的简单(使用chardet)

2025/8/11 22:37:37发布23次查看
本文实例讲述了python判断字符串编码的方法。分享给大家供大家参考,具体如下:
安装chardet模块
chardet文件夹放在/usr/lib/python2.4/site-packages目录下
[root@sha-sso-data01 chardet]# python python 2.4.3 (#1, sep 21 2011, 19:55:41) [gcc 4.1.2 20080704 (red hat 4.1.2-51)] on linux2 type "help", "copyright", "credits" or "license" for more information.
>>> import chardet >>> chardet.detect("我") {'confidence': 0.505, 'encoding': 'utf-8'} >>>
更多python判断字符串编码的简单(使用chardet)。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product