msg = "你好,世界" print(type(msg),msg) msg1= msg.encode(encoding="utf-8") #转换成bytes print(type(msg1),msg1) print(msg1.decode(encoding="utf-8")) #转换成str
标签:code blog type gpo utf-8 class coding log odi
msg = "你好,世界" print(type(msg),msg) msg1= msg.encode(encoding="utf-8") #转换成bytes print(type(msg1),msg1) print(msg1.decode(encoding="utf-8")) #转换成str
标签:code blog type gpo utf-8 class coding log odi
原文地址:https://www.cnblogs.com/it-farmer123/p/8571508.html