标签:encode class python request ane pre requests import system
import chardet print(chardet.detect(b‘Hello,world‘)) #{‘encoding‘: ‘ascii‘, ‘confidence‘: 1.0, ‘language‘: ‘‘}
import chardet data=‘离离原上草,一岁一枯荣‘.encode(‘gbk‘) print(chardet.detect(data)) #{‘encoding‘: ‘GB2312‘, ‘confidence‘: 0.7407407407407407, ‘language‘: ‘Chinese‘}
import chardet data=‘最新の主要ニュース‘.encode(‘euc-jp‘) print(chardet.detect(data)) #{‘encoding‘: ‘EUC-JP‘, ‘confidence‘: 0.99, ‘language‘: ‘Japanese‘}
标签:encode class python request ane pre requests import system
原文地址:https://www.cnblogs.com/larry-xia/p/9129570.html