470,815 Members | 1,090 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

2.0: reading utf-8 text file with non-ASCII letters

Hello,
Could you help me please with a problem of reading utf-8 file with
non-ASCII (Polish) letters? I have written such code:

DirectoryInfo D = new
DirectoryInfo(HttpContext.Current.Request.Physical ApplicationPath);
foreach (FileInfo F in D.GetFiles("*.aspx"))
{
string S;
using (StreamReader R = new StreamReader(F.FullName, Encoding.UTF8))
while ((S = R.ReadLine()) != null)
...
}

The problem is that non-ASCII letters are ignored, for instance text
in Polish:
górą
is read:
S == "gr".

Could you tell me please how to solve the problem?
Thank you very much!
/RAM/
May 22 '06 #1
1 1359
If that is the case, then I would say that the file you are trying to
read is not UTF8 encoded. I'm not sure what encoding includes Polish
characters but I would think that is the encoding to use.

May 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by Haines Brown | last post: by
6 posts views Thread by archana | last post: by
7 posts views Thread by Jimmy Shaw | last post: by
35 posts views Thread by Bjoern Hoehrmann | last post: by
reply views Thread by moorcroft | last post: by
2 posts views Thread by moorcroft | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.