As far as I can tell there is no way to tell the encoding.
can tell you whether it's ASCII text or not, but not the encoding. Essentially the encoding is context-dependent and nothing in the file as such defines it.
This thread: http://discuss.fogcreek.com/joelonso...w&ixPost=82874
goes through some of the issues and misunderstandings regarding character encoding.
file -i filename
will give you the MIME type, which can be useful, but it's not what you're seeking. It can't tell you the character encoding.