Library for detecting character encoding in text files and streams
Encoding detector library
uchardet
$ uchardet file.txt
$ uchardet file1.txt file2.txt file3.txt
$ cat unknown_file.txt | uchardet