读写文件都要将中文转为unicode字符。 读文件: u = unicode(s, 'gbk') 这里不能使用encode 写文件: u = encode('utf') 转载于:https://www.cnblogs.com/testlife007/p/4179060.html