python编码与反编码 decode('unicode-escape')

      “反编码”我自己起的名字,大概意思就是我得到一串字符,是unicode码,如:‘\u53eb\u6211’,进行反编码后得到其对应的汉字。

f='\u53eb\u6211'
print f
print(f.decode('unicode-escape'))


 

结果为:

\u53eb\u6211
叫我

你可能感兴趣的:(python编码与反编码 decode('unicode-escape'))