unicode转中文python
发布时间: 2025-02-07 12:45:21
Ⅰ 怎么将python所有unicode转换成中文格式
中文格式就是utf8呗
In[1]:s=u"中国"
In[2]:s
Out[2]:u'u4e256fd'
In[3]:new=s.encode("utf8")
In[4]:printnew
中国
In[5]:new
Out[5]:'xe4xb8xadxe5x9bxbd'
In[6]:
如果解决了您的问题请采纳!
如果未解决请继续追问
热点内容