I don't get ÅÄÖ when I use StramReader.ReadtoEnd()

T

Tony Johansson

Hello!

I'm from sweden so we use åäö.
If I just use notepad and open this file I get the correct characters and
here is the swedish text
Detta hotell i Paris erbjuder restaurang och bar/lounge.
Kostnadsfri trådlös tillgång till Internet finns i allmänna utrymmen.

If I instead open the file programatically by using StreamReader and assign
the result to a label I don't get åäö but instead
these strange characters.?
Here is the text that is wrong and as you can see we have these strange ?
characters
Detta hotell i Paris erbjuder restaurang och bar/lounge.
Kostnadsfri tr?dl?s tillg?ng till Internet finns i allm?nna utrymmen.

Here is how I use StreamReader
using(StreamReader sr = new StreamReader(filePath))
{
lblInfo.Text = sr.ReadToEnd();
}

So what should I do to be able to write the text correctly with åäö

//Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top