0

I have a text file with special characters in it. The content are like this.

Test note with à and é

When opening the text file in notepad, it looks fine. But when reading the content of the file using StreamReader. These special characters changes to something looks like a ? enclosed in a diamond shape.

I did used the standard encoding UTF-8 but to no avail

mercu
  • 121
  • 1
  • 14
  • What encoding do you open the file with in Notepad? (The encoding is shown on the Open File dialog.) Be aware that Silverlight doesn't support many encodings, see http://stackoverflow.com/questions/1452366/is-iso-8859-1-supported-in-silverlight. – Luke Woodward Mar 09 '13 at 20:33
  • I tried to open the file on notepad and only ANSI encoding displays it correctly. Do I have no other choice to correclty read the file? Thanks for any help. – mercu Mar 11 '13 at 05:17
  • If it's not possible to convert the text file to UTF-8, you might have to create your own custom [Encoding](http://msdn.microsoft.com/en-us/library/system.text.encoding%28v=vs.95%29.aspx) for 'ANSI'. However, before you do that you'll have to determine exactly what encoding 'ANSI' actually is - see http://stackoverflow.com/questions/701882/what-is-ansi-format . – Luke Woodward Mar 11 '13 at 22:21

0 Answers0