编码问题-python3

来源:互联网 发布:mysql默认配置文件 编辑:程序博客网 时间:2024/06/06 14:10

encode 把 str 加码成 bytes

>>> type('abc'.encode('gbk'))<class 'bytes'>

decode 把 bytes 解码成 str

>>> s = 'abc'.encode('gbk')>>> type(s.decode('gbk'))<class 'str'>


0 0