Test file input output trouble!

J

Jens Jensen

I use StreamReader and StreamWriter to manipulate a text file file .
The problem is that my Norgian characters get altered.

How can i preserve the character set to ASCI ?

Thanks
JJ
 
M

Morten Wennevik

Hi Jens,

The default encoding for StreamReader/StreamWriter is UTF8. I'm guessing
the file isn't UTF8-encoded, so you need to use the overloaded constructor
and specify the proper encoding before you read/write. Try
Encoding.Default.
 
J

Jens Jensen

Well My question was badly formulated,but you gave the correct response.

Many thanks
JJ
 

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