ff=open('text-utf8.txt','w',encoding='utf8') for l in open('text_othe_encoding.txt','r',encoding='othe_encoding',errors='ignore'): ff.write(l)