msg = "你好,世界"print(type(msg),msg)msg1= msg.encode(encoding="utf-8") ?#转换成bytesprint(type(msg1),msg1)print(msg1.decode(encoding="utf-8")) #转换成str
encode,decode,str to bytes
原文地址:https://www.cnblogs.com/it-farmer123/p/8571508.html
msg = "你好,世界"print(type(msg),msg)msg1= msg.encode(encoding="utf-8") ?#转换成bytesprint(type(msg1),msg1)print(msg1.decode(encoding="utf-8")) #转换成str
encode,decode,str to bytes
原文地址:https://www.cnblogs.com/it-farmer123/p/8571508.html