将字符串str =’\u98ce\u534e\u7684\u51b2\u950b'转换成汉字显示

可以直接print输出

print u'\u98ce\u534e\u7684\u51b2\u950b'

但是这样在处理json文件中的编码就比较麻烦,可以将整串字符串转化:

    s = str.encode('latin-1').decode('unicode_escape')

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案