c# encoding problems (question marks) while reading file from StreamReader -


I have a problem reading a .txt file from my Windows Phone AP.

We have created a simple app that reads a stream from the .txt file and prints it.

Unfortunately I am from Italy and we have accents with many letters and here's the problem, in fact all the marks are printed as a question mark.

Here is the sample code:

  var resourceStream = Application.GetResourceStream (new ury ("frasi.txt", UriKind.RelativeOrAssolute)); If (sourceStream! = Null) {{//System.Text.Encoding.Default, true (var reader = new StreamReader (resourceStream.Stream, System.Text.Encoding.UTF8)) {string string; Line = reader. Readline (); While (line! = Null) {frasi.Add (line); Line = reader. Readline ();   

: I was encoded in UTF -8 file that it was not sure I saved it with the right encoding and it worked like a charm thank you Oscar

you should change Chahia.difolt using encoding:

  (var reader = new using streamReader (resourceStream.stream, System.Text.Encoding.UTF8))  

to

  (var reader = new Strymrider (Resourkestrymkstrym, Sistmktekst.ancodingkdifaolt))  

Comments