Extract logic from the cli
Encoding detector