在mac上打开终端
输入
python回车

中文转换成unicode

python

然后输入 要转换的中文,例如"张三"

unicode ('张三','utf-8')

执行结果:

u'\u5f20\u4e09'

unicode转换成中文

python

然后输入 要转换的unicode

print '\xc2\xa5'

执行结果:

¥
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐