How to auto detect text file encoding?
- by ???
There are many plain text files which were encoded in variant charsets.
I want to convert them all to UTF-8, but before running iconv, I need to know its original encoding. Most browsers have an Auto Detect option in encodings, however, I can't check those text files one by one because there are too many.
Only having known the original encoding, I then can convert the texts by iconv -f DETECTED_CHARSET -t utf-8.
Is there any utility to detect the encoding of plain text files? It doesn't have to be a 100% perfect correct, but it should recognize most of them.