This question already has answers here:
Closed 9 years ago.
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#?