import chardet f = open(file='test1.txt', mode='rb') data = f.read() print(chardet.detect(data)) 相关文章: