Python编码转换代码

# -*- coding:utf-8 -*-

temp = '李姐'
temp_unicode = temp.decode('utf-8')

temp_gbk = temp_unicode.encode('gbk')
print temp_gbk 

  

posted @ 2017-02-08 11:03  极客易先生  阅读(240)  评论(0编辑  收藏  举报