Test file input output trouble!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jens Jensen

    Test file input output trouble!


    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


  • Morten Wennevik

    #2
    Re: Test file input output trouble!

    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.Defaul t.


    On Wed, 18 Oct 2006 11:12:28 +0200, Jens Jensen <jj@jensen.dkwr ote:
    >
    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
    >
    >


    --
    Happy Coding!
    Morten Wennevik [C# MVP]

    Comment

    • Jens Jensen

      #3
      Re: Test file input output trouble!

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

      Many thanks
      JJ


      Comment

      Working...