I\'m using the StreamReader class in .NET like this:
using( StreamReader reader = new StreamReader( \"c:\\somefile.html\", true ) {
string filetext = rea
A hacky technique might be to take an MD5 of the text, then decode the text and re-encode it in various encodings, MD5'ing each one. If one matches you guess it's that encoding.
That's obviously too slow for something that handles a lot of files but for something like a text editor I could see it working.
Other than that, it'll be hands dirty porting the java libraries from this post that came from the Delphi SO question, or using the IE MLang feature.