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?
Loading
VulpesPosted Sep 18, 2012, 11:30 AM
However, one thing you could do is to look for bytes with values between 128 and 159 (0x80 and 0x9F hex). If there are any of these, then there's a high probability that it's a Windows-1252 file because these characters represent (rarely used) non-printing control characters in Unicode and therefore UTF-8.