2019年1月19日

python3编码转换

摘要: 1 a='我很好' #python3 默认的编码为unicode 2 print('我是a',a,type(a)) #打印结果: 3 #把a转成gb2312 4 a_gb2312=a.encode('gb2312') #默认是unicode所以不需要decode(),直接encode成想要转换的编码gb2312 5 print('我是gb23... 阅读全文

posted @ 2019-01-19 15:53 「枫」 阅读(282) 评论(0) 推荐(0) 编辑

导航