f3 = open(file=path,mode='rb') data = f3.read() # print(data) f3.close() result = chardet.detect(data) print(result)
结果:
{'encoding': 'Big5', 'confidence': 0.99, 'language': 'Chinese'}
f3 = open(file=path,mode='rb') data = f3.read() # print(data) f3.close() result = chardet.detect(data) print(result)
结果:
{'encoding': 'Big5', 'confidence': 0.99, 'language': 'Chinese'}