detect_file_enc()
String encoding detection
detect_raw_enc()
Raw bytes encoding detection
detect_str_enc()
uchardet
The Universal Character Encoding Detector