1 msg = 我是中国人 2 3 print(msg) 4 5 转换二进制 6 print(msg.encode(encoding='utf-8')) 7 转回来 8 9 print(msg.encode(encoding='urf-8').decode(decoding=''utf-8))