当前位置: 代码迷 >> 综合 >> unicode 转换 -- python
  详细解决方案

unicode 转换 -- python

热度:71   发布时间:2024-02-24 22:29:38.0

str = u'上海'uni = str.encode('unicode-escape')uni
Out[55]: b'\\u4e0a\\u6d77'uni.decode()
Out[56]: '\\u4e0a\\u6d77'print(uni)
b'\\u4e0a\\u6d77'

 

  相关解决方案