# -*- coding:utf-8 -*- temp = ‘李姐‘ temp_unicode = temp.decode(‘utf-8‘) temp_gbk = temp_unicode.encode(‘gbk‘) print temp_gbk
Python编码转换代码
原文:http://www.cnblogs.com/yigongzi/p/6377255.html