加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python编码知识点(倒序更新)

发布时间:2020-12-17 01:24:40 所属栏目:Python 来源:网络整理
导读:在python中进行编码转换都是通过unicode作为中间值实现的。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode(gb2312),表示将gb2312编码的字符串转换成unicode编码。 encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode(

在python中进行编码转换都是通过unicode作为中间值实现的。

decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode(gb2312),表示将gb2312编码的字符串转换成unicode编码。

encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode(gb2312),表示将unicode编码的字符串转换成gb2312编码。

<div class="line number5 index4 alt2" style="font-size:13.3333339691162px;font-family:Monaco,Menlo,Consolas,'Courier New',monospace;line-height:14.6666669845581px;color:rgb(51,51,51);border:0px !important;overflow:visible !important;vertical-align:baseline !important;min-height:auto !important;background-color:rgb(245,245,245);">
<code class="python plain" style="font-family:Monaco,monospace;border:0px !important;line-height:1.1em !important;overflow:visible !important;vertical-align:baseline !important;min-height:auto !important;font-size:13px !important;color:rgb(0,0) !important;background:none !important;">>>>?<code class="python keyword" style="font-family:Monaco,monospace;border:0px !important;line-height:1.1em !important;overflow:visible !important;vertical-align:baseline !important;font-weight:700 !important;min-height:auto !important;font-size:13px !important;color:rgb(255,120,0) !important;background:none !important;">import?<code class="python plain" style="font-family:Monaco,0) !important;background:none !important;">codecs

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读