码迷,mamicode.com
首页 > 其他好文 > 详细

编码转换

时间:2019-01-06 18:26:58      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:decode   int   encode   包含   转换   span   color   nbsp   enc   

编码
编码的转换
s = alex
s1 = s.encode(utf-8)   # 编码     utf-8  包含了ascii
print(s1.decode(gbk))  # 解码     gbk    包含了ascii

 



编码转换

标签:decode   int   encode   包含   转换   span   color   nbsp   enc   

原文地址:https://www.cnblogs.com/yanranran/p/10229144.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!