码迷,mamicode.com
首页 > 编程语言 > 详细

python头疼的编码问题

时间:2016-10-15 02:21:50      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

escape_string 序列 转中文输出
escape_string=\u559c\u6b22\u4e00\u4e2a\u4eba
print escape_string.decode(raw_unicode_escape)

str 转 utf8编码 unicode:
str_string.decode(utf8)

unicode 转  utf8编码 str:
unicode_string.encode(utf8)

 

python头疼的编码问题

标签:

原文地址:http://www.cnblogs.com/zsl-3/p/pyhton.html

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