摘要: 环境:idle# coding:utf-8str1="\u7b11\u8138.gif"print str1.decode("raw_unicode_escape") #控制台输出:笑脸.gifstr2="\xd0\xa6\xc1\xb3.gif"print str2.decode("gbk") #控制台输出:笑脸.gif,程序内部表示为u'\u7b11\u8138.gif'decode将其他编码的字符串转换成unicode编码如str1.decode('gbk')或unicode( 阅读全文
posted @ 2012-04-11 16:28 lost2x 阅读(266) 评论(0) 推荐(0) 编辑