msg = "我爱你"print(msg.encode(encoding='utf-8')) #转成bytes类型文件 编码print(msg.encode(encoding="utf-8").decode(encoding="utf-8")) #转回str字符串类型 先编码-->解码