设置编码#-*-coding:uft-8-*- (不是下横线,横线在中间)或#coding:utf-8或#coding=utf-8转换str="中文"print(str.decode("gbk").encode("utf-8"))