【原创】python 简繁体转换

来源:互联网 发布:开淘宝店怎么代销不了 编辑:程序博客网 时间:2024/06/03 20:52
比较不错的简繁体转换 pyjft (百度云盘下载),注意:不能有逗号等特殊符号~~
现在合并到:pyzh
这个就是简繁体转换关键代码
谷歌 code下载pyjft.py。


>>> a=u'飞机飞向蓝天'
>>> res=jft.j2f('gbk','utf8',a.encode('gbk')).decode('utf8')
飞机飞向蓝天
>>> res
u'\u98db\u6a5f\u98db\u5411\u85cd\u5929'
>>> print res
飛機飛向藍天
>>>

from __future__ imports must occur at the beginning of thefile
0 0
原创粉丝点击