Fetch the Encoding type of a file in C#

Sep 18 2012 9:35 AM
Hi,
I was trying to find the encoding type of a file like unicode, utf8, utf8 without BOM, ANSI etc. I was able to find all the encoding type but ANSI(Encoding.Default/Windows- 1252). I am not able to differentiate ANSI and UTF8. Tried different custom class like (Ude, TextFileEncodingDetector etc) which guesses it but not exactly right. Is there any way to do it? 

Answers (1)