Reading .txt files

  • Thread starter Thread starter Mats Boberg
  • Start date Start date
M

Mats Boberg

Hi,

I'm reading a .txt template and replace diffrent tags with the actual
data( replacing <address> with "Kattsundsgatan 12:5tr).

My customer is from denmark and uses åæø chars and I'm from sweden and use
åäö chars.

When I read the file with a streamreader the åäö chars get messed up in the
string.

Anyone got a tip for keeping the åäö unchanged after reading the .txt file
to a string?!


--
Mats Boberg

Regfellow
Kattsundsgatan 12:5tr
21126 Malmö

Tele: 040 611 48 20
Mob: 070 486 87 57
 
have you try to use a constructor with an Encoing argument ?
like
new StreamReader(filename, Encoding.UTF8);
or something like that ?

hopes it helps ....
 
Thanx for the tip!

Encoding.ASCII didn't work, but Encoding.Default did... strange... but I'm
happy you could solve the problem.

/Mats.
 
Back
Top