From http://stackoverflow.com/questions/1730878/encoding-of-file-shell-script - Get encoding information about a file.