reading special characters.
-
Hi, I am reading the contents of a file and displaying it in a lable on a web page. There are also some special characters in the file such as :
à
é
The problem is that these chars are converted to square blocks like this�
in display. And this the the code i am using to read the file:FileStream file = new FileStream(FilePath, FileMode.Open, FileAccess.Read); // Create a new stream to read from a file StreamReader sr = new StreamReader(file); // Read contents of file into a string string s = sr.ReadToEnd(); // Close StreamReader sr.Close(); // Close file file.Close();
And this is the code whihc i am using to display the contents:lblStaticContent.Text = s.ToString();
Please help.Deepak Surana
-
Hi, I am reading the contents of a file and displaying it in a lable on a web page. There are also some special characters in the file such as :
à
é
The problem is that these chars are converted to square blocks like this�
in display. And this the the code i am using to read the file:FileStream file = new FileStream(FilePath, FileMode.Open, FileAccess.Read); // Create a new stream to read from a file StreamReader sr = new StreamReader(file); // Read contents of file into a string string s = sr.ReadToEnd(); // Close StreamReader sr.Close(); // Close file file.Close();
And this is the code whihc i am using to display the contents:lblStaticContent.Text = s.ToString();
Please help.Deepak Surana