設(shè)置編碼
#-*-coding:uft-8-*- ?(不是下橫線,橫線在中間)
或
#coding:utf-8
或
#coding=utf-8
轉(zhuǎn)換
str="中文"
print(str.decode("gbk").encode("utf-8"))
設(shè)置編碼
#-*-coding:uft-8-*- ?(不是下橫線,橫線在中間)
或
#coding:utf-8
或
#coding=utf-8
轉(zhuǎn)換
str="中文"
print(str.decode("gbk").encode("utf-8"))