美文网首页
python 把\u开头的unicode转中文

python 把\u开头的unicode转中文

作者: theo_NI | 来源:发表于2018-11-10 20:24 被阅读0次

python3 把\u开头的unicode转中文

  • python3 中
i.encode('utf-8').decode('unicode_escape')  #i='\u751F\u5316\u5371\u673A'
  • python2 中
i.decode('unicode-escape')
  • 总结 unicode_escape可看作Unicode的反向编码,属于unicode存储到文本的过程中另一种存储方式

参考 http://www.qmailer.net/archives/251.html

相关文章

网友评论

      本文标题:python 把\u开头的unicode转中文

      本文链接:https://www.haomeiwen.com/subject/vurtfqtx.html