python3.5.2中文字符乱码问题解决

it2025-10-30  14

 

>>> str = "世界你好!" >>> b = str.encode('utf-8') >>> type(b) <class 'bytes'> >>> b b'\xe4\xb8\x96\xe7\x95\x8c\xe4\xbd\xa0\xe5\xa5\xbd!' >>> b.decode('utf-8') '世界你好!'

  

转载于:https://www.cnblogs.com/luoye00/p/7099663.html

相关资源:python3.5官方文档中文版
最新回复(0)