python中decode和encode的區別

#-*-coding:utf-8 import sys ''' *首先要搞清楚,字符串在Python內部的表示是unicode編碼,所以,在作編碼轉換時,一般須要以unicode做爲中間編碼, 即先將其餘編碼的字符串解碼(decode)成unicode,再從unicode編碼(encode)成另外一種編碼。 decode的做用是將其餘編碼的字符串轉換成unicode編碼,如str1.decode(
相關文章
相關標籤/搜索