المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : wrong behaviour of Text Reader



C# Programming
05-30-2009, 03:40 PM
Hi there.........
I am using text reader to read a text file. I have used the following code:

string str = "C:\\MKS.txt";
TextReader textreader = new StreamReader(str);
string inline = "";
while ((inline = textreader.ReadLine()) != null)
{
if (rtEngData.Text == "")
{
rtEngData.Text = inline;
}
else
{
rtEngData.Text = rtEngData.Text + Environment.NewLine + inline;
}
}



Here in my input file (in this code C:\MKS.Txt), a character ë is used.
(Go to the notepad and type ALT+0235, you will get the character.)
Now when I read this file, for this character it reads '?' .

Please tell me if there is any problem with my code block. or suggest me to get proper character.
Thanks....
Vishal.