import codecs
import os
     #格式转换
	fhanzi1 = codecs.open(os.path.join(outputpath,"hanzi1.txt"),"r")
	fhanzi = codecs.open(os.path.join(outputpath,"hanzi.txt"),"w")
	
	result_f = codecs.EncodedFile(fhanzi1,'utf-8','gbk')
	
	for chars in result_f:
		fhanzi.write(chars)
	
	fhanzi1.close()
	fhanzi.close()
	
	os.remove(os.path.join(outputpath,"hanzi1.txt"))

  

posted on 2016-07-08 18:15  小白闯天下  阅读(2767)  评论(0编辑  收藏  举报