gsivaram gsivaram - 1 year ago 146
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download