python 判断 txt 编码方式

import chardet
 
f = open('/path/file.txt',r)
data = f.read()
print(chardet.detect(data)

 

posted @ 2019-02-25 19:12  清源居士  阅读(1658)  评论(0编辑  收藏  举报