python的encode()和decode()函数,,decode()函数
python的encode()和decode()函数,,decode()函数
decode()函数的作用是用作解码,encode()函数是用作编码。
decode函数以encoding指定的编码格式解码字符串,默认是字符串编码。
语法是:
str.decode(encoding=‘utf-8‘)
encode函数以encoding指定的编码格式编码字符串。
语法是:
str.encode(encoding)
encoding指定要使用的编码。
python的encode()和decode()函数
评论关闭