代码:
1 import codecs 2 from unidecode import unidecode 3 4 def main(): 5 fullFilename="123.txt" 6 inFID=codecs.open(fullFilename,'r','utf-8') 7 ALines = inFID.readlines() 8 for k in range(len(ALines)): 9 ALines[k] = unidecode(ALines[k]) 10 print(ALines[k]) 11 inFID.close() 12 13 main()
参考:
http://blog.csdn.net/suofiya2008/article/details/5579413