Results 1 to 2 of 2

Thread: streamreader

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    14

    streamreader

    Hi all,

    I have a problem with a system.io.streamreader. I'm using the following code :

    Dim sr As System.IO.StreamReader
    sr = New System.IO.StreamReader(strPathAndFileProducts)

    str = sr.ReadLine
    sr.close

    Reading normal text works fine however when the text contains special chars such as - àáâãäåæçèéêë - the streamreader does not read them. For example "Frühbuchen" reads as "Frhbuchen".

    Is there some kind of setting in the streamreader to avoid this or perhaps another way to read the file. btw i'm using VB2003 (.net framework 1.1).

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Re: streamreader

    The StreamReader has a property called CurrentEncoding. Try setting that to Unicode (or one of the other options) and see if that helps. By default, the object may just read ASCII, or something like that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width