1252 coding does not work on my files as I mentioned above. Neither do any of the other encodings.
I tried djinn01's technique for finding the encoding of the file. 1252 was what came up. VS maybe makes a guess like IE? It's weird everything that you open the file with works ok except for...
I've done some research elsewhere and it would appear I'm not the only one to have discovered this problem. Just do a search on Google groups and you'll find loads - none with a fix.
You can also use for example:
StreamReader sr = new...
The problem is that the file is not UTF8 or any of the other formats that the StreamReader seems to support. The file is text from a UNIX system. The characters are all (I think) extended ASCII. The files will open fine in notepad or the .NET IDE or whatever.
It would seem .NET has a textreader...
I'm using a StreamReader to process files from different countries in this simple way:
StreamReader sr = new StreamReader(@"c:\test",System.Text.Encoding.UTF8);
while((row=sr.ReadLine()) != null)
{
//process the line
}
sr.Close();
However the reader just ignores non-standard...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.