msg = "我爱北京"print(msg)print(msg.encode(encoding="utf-8"))#转二进制print(msg.encode(encoding="utf-8").decode(encoding="utf-8"))#转utf-8
我爱北京b'\xe6\x88\x91\xe7\x88\xb1\xe5\x8c\x97\xe4\xba\xac'我爱北京