How to guess the encoding of a file with no BOM in .NET?
Libary http://www.codeproject.com/KB/recipes/DetectEncoding.aspx
And perhaps a useful thread on stackoverflow
You should read this article by Raymond Chen. He goes into detail on how programs can guess what an encoding is (and some of the fun that comes from guessing).
Some files come up strange in Notepad