I have big file with utf16le (BOM) encoding.
Is it possible to convert it to usual UTF8 by python?
Something like
file_old = open('old.txt', mode='r', encoding='utf-16-le')
file_new = open('new.txt', mode='w', encoding='utf-8')
text = file_old.read()
file_new.write(text.encode('utf-8'))
http://docs.python.org/release/2.3/lib/node126.html (-- utf_16_le UTF-16LE)
Not working. Can't understand "TypeError: must be str, not bytes" error.
python 3