hello!python!
摘要: decode 解码encode 转码unicode是一种编码,具体可以百度搜# coding: UTF-8 u = u'汉'print repr(u) # u'\u6c49's = u.encode('UTF-8')print repr(s) # '\xe6\xb1\x89'u2 = s.decode('UTF-8')print repr(u2) # u'\u6c49' # 对unicode进行解码是错误的# s2 = u.decode('UTF-8')# 同样,对str进行编码也是 阅读全文
posted @ 2013-12-20 11:29 你坚持了吗 阅读(2895) 评论(0) 推荐(0) 编辑
hello!python!