Possible Duplicate:
Determine a string's encoding in C#
Many text editorsr (like Notepad++) can detect encoding of arbitrary file. Can I detect encodoing of file in C#?
Possible Duplicate:
Determine a string's encoding in C#
Many text editorsr (like Notepad++) can detect encoding of arbitrary file. Can I detect encodoing of file in C#?
A StreamReader will try to automatically detect the encoding of a file if there's a BOM when trying to read: