0%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| import chardet
print(chardet.detect(b'Hello, world!'))
data1 = '离离原上草,一岁一枯荣'.encode('gbk') print(chardet.detect(data1))
data2 = '离离原上草,一岁一枯荣'.encode('utf-8') print(chardet.detect(data2))
data3 = '最新の主要ニュース'.encode('euc-jp') print(chardet.detect(data3))
|