Marcisu,
As Marshal suggets, ASCII does not include the ñ & Ñ characters, as ASCII is
a 7 bit encoding. You need an 8 or 16 bit encoding to read ñ & Ñ.
In addition to trying the UTF8 encoding I would recommend the Default
encoding, as that is the encoding that is specific under your Windows
Control Panels.
Something like:
| StreamReader sFile = new StreamReader(filename,
System.Text.Encoding.Default);
Hope this helps
Jay
[quoted text, click to view] "Macisu" <Macisu@discussions.microsoft.com> wrote in message
news:CE7D1230-74B3-48D6-B433-1E640B9F816E@microsoft.com...
| Hi
|
| I am using the object Stream Reader to read Files. The method ReadLine()
| does not read the character ñ o Ñ.
|
| What Can i do?
|
| Helpme please
|
| thanks
|
| Macisu
|
| It does not work
|
| StreamReader sFile = new StreamReader(ASCIIEncoding.ASCII);
|
| byte[] bytes =
| System.Text.Encoding.ASCII.Getbytes(sFile.ReadLine(:ToCharArray());
| s=System.text.Encoding.ASII.GetString(bytes);
|
| s is wrong,
|
| Ideas?
|