Python String decode()

介绍

该方法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()注册的任何其他名称。

返回值

返回解码的字符串。

转载于:https://my.oschina.net/vhacker/blog/840215

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值