首页 > 编程语言 > 详细

python的encode()和decode()函数

时间:2020-07-05 00:08:05      阅读:67      评论:0      收藏:0      [点我收藏+]

decode()函数的作用是用作解码,encode()函数是用作编码。

decode函数以encoding指定的编码格式解码字符串,默认是字符串编码。
语法是:
str.decode(encoding=‘utf-8‘)

encode函数以encoding指定的编码格式编码字符串。
语法是:
str.encode(encoding)
encoding指定要使用的编码。

python的encode()和decode()函数

原文:https://www.cnblogs.com/noob-l/p/13237144.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!