uchardet

Library for detecting character encoding in text files and streams

brewmacoslinux
Try with needOr install directly
Source

About

Encoding detector library

Commands

uchardet

Examples

Detect encoding of a single file$ uchardet file.txt
Detect encoding of multiple files$ uchardet file1.txt file2.txt file3.txt
Detect encoding from stdin$ cat unknown_file.txt | uchardet