Missing characters when reading from a file

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hello,

I have the following reader function :

public static string[] fileReadAllLines(string strFileName)
{
ArrayList content = new ArrayList();

using (StreamReader sr = File.OpenText(strFileName))
{
string input;
while ((input = sr.ReadLine()) != null)
{
content.Add(input);
}
sr.Close();
}

return toStringArray(content);
}

which also can be replaced with :

public static string[] fileReadAllLines(string strFileName)
{
return File.ReadAllLines(strFileName);
}

Both those methods remove all special characters (é,è,ø,æ,...) from the stream, what to do to get them ?

Thanks
.



Relevant Pages

  • Re: Missing characters when reading from a file
    ... public static string[] fileReadAllLines(string strFileName) ... using (StreamReader sr = new StreamReader(fs, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Missing characters when reading from a file
    ... public static string[] fileReadAllLines(string strFileName) ... The StreamReader uses UTF-8 encoding if not told otherwise. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Correct non page class?
    ... You can use HttpContext.Current ...which'll be null for non-web requests so you won't be able to re-use that class in a winform...not like you can re-use it now anyways.. ... public static string BookList(System.Web.HttpServerUtility pServer){ ... StreamReader sr = new StreamReader); ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Download URL Up to XXX Bytes
    ... StreamReader only gives you information about characters read, ... public static string DownloadUrl ... Note that I don't need to deal with bytes, encoding or much of anything else for that matter. ... I'd simply like to stop reading once the number of bytes OR characters is a certain amount. ...
    (microsoft.public.dotnet.languages.csharp)