JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

【python】unicode转中文

发布时间 2023-07-25 10:55:13作者: 代码诠释的世界

1、处理方法

text = u'\xe9\x95\xbf\xe5\x9f\x8e'
text = text.encode('unicode-escape').decode('string_escape')
print(text.decode('utf8'))

 

参考链接:

(90条消息) python 中 unicode原样转成str, unicode-escape与string_escape_".encode(\"string_escape\")"_小橘子Pythoner的博客-CSDN博客

    本栏目推荐文章
  • Python学习笔记
  • python字典的使用
  • python字符串方法
  • python列表和元组使用介绍
  • python | 小游戏 开局托儿所 自动化脚本 pyautogui
  • python中的Map和Filter
  • python-爬元气桌面壁纸
  • python中的*args**和**kwargs
  • Python教程(23)——Python类中常用的特殊成员
  • linux环境Python安装
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们