0

How to identify between ANSI encoded text files and UTF-8 text files in vb.net? I use the method StreamReader.CurrentEncoding.CodePage For both ANSI files and UTF-8 files the code page value will be 65001. Is there any other way to identify both these file encoding types as it is done by Notepad, where it displays ANSI and UTF-8 separately.

user1242496
  • 139
  • 2
  • 8
  • If there is no byte-order-mark, and the character data in the file is all in the 0-127 range, then **there is no difference** at all. None. So you cannot detect a difference that isn't there. Is there a byte-order-mark? Is there any character data above 127? – Marc Gravell Mar 01 '12 at 12:23
  • Have a look at this: http://stackoverflow.com/questions/3404199/how-to-find-out-the-encoding-of-a-file-c-sharp – Andre Loker Mar 01 '12 at 12:25

0 Answers0