for index,value in enumerate(listvalue): adchar=chardet.detect(value) print adchar if adchar['encoding']=='utf-8' or adchar['encoding']=='ascii': code='utf-8' else: code='GBK' value=value.decode(code)#解码生成unicode编码
for index,value in enumerate(listvalue): adchar=chardet.detect(value) print adchar if adchar['encoding']=='utf-8' or adchar['encoding']=='ascii': code='utf-8' else: code='GBK' value=value.decode(code)#解码生成unicode编码