Results 1 to 6 of 6

Thread: reading special characters from a text file RESOLVED

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    27

    reading special characters from a text file RESOLVED

    I have the following code which will read "normal" characters from any textfile just fine:

    Code:
               
               Dim oRead As StreamReader
                Dim oFile As File
                Dim currentLine As System.String
                oRead = oFile.OpenText(Global.directory)
    
                While oRead.Peek <> -1
                    currentLine = oRead.ReadLine()
                    If Not File.Exists(Global.homedirectory + "\teste.txt") Then
                        Dim oWrite As New System.IO.StreamWriter(Global.homedirectory + "\teste.txt")
                        oWrite.WriteLine(currentLine)
                        oWrite.Close()
                    End If
                    MessageBox.Show(currentLine)
    
                End While
                oRead.Close()
    But my problem is, that it does not read special characters.

    My textfile contains: "ašššb" . But Readline() reads only "ab".

    I thought UTF-8 supports foreign characters? But apparently, it does not.

    Any help is appreciated.

    Thanx,
    Usul
    Last edited by Usul; Jul 30th, 2004 at 04:44 AM.

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