How to detect the encoding of a file

I was looking for a way to see what encoding a specific file had and didn’t know about this smart little terminal commando you could run

file -I jquery.js  

Using the -I (that's a capital i) option on the file command, it shows the file encoding.
jquery.js: application/octet-stream; charset=binary