编码与解码

decode:将其他编码的字符串转换成unicode编码,如str1.decode('utf-8'),表示将utf-8的编码转换成unicode编码。

encode:将unicode编码转换成其他编码的字符串,str2.encode('utf-8'),表示将unicode编码的字符串转换成utf-8编码。

decode是解码,encode是编码

 

posted @ 2019-11-12 11:34  胸怀丶若谷  阅读(112)  评论(0编辑  收藏  举报