介绍
该方法decode()使用注册的编解码器解码该字符串编码。 默认字符串str encoding。
The method decode() decodes the string using the codec registered for encoding. It defaults to the default string encoding.
用法
Str.decode(encoding='UTF-8', errors='strict')
Parameters
encoding 这是要是用的编码 errors 这可以给设置不同的错误处理方案。错误的默认值是'strict',这意味着编码错误会引发UnicodeError。其他可能的值是“ignore”,“replace”,“xmlcharrefreplace”,“backslashreplace”以及通过codecs.register_error()注册的任何其他名称。
返回值
返回解码的字符串。