gsivaram gsivaram - 9 months ago 53
Python Question

File encoding from English text to UTF-8

How to convert a Non-ISO extended-ASCII English text, with CRLF line terminators to utf-8 in Python


Extending Jishiyu's Answer, you might use uchardet to identify the char set. For example

iconv -f `uchardet a_strange_file.txt` -t UTF-8 -o the_output_file.txt a_strange_file.txt

Although this does not do the job in python.