python头疼的编码问题

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')

 

posted @ 2016-10-14 23:54  恰似少年  阅读(200)  评论(0编辑  收藏  举报