-
October 8th, 2009, 05:35 PM
#1
Streamreader / Accented Character / Urgent
My code is below, and has been simplified. My problem is when the file I am reading contains an accented character the streamreader simply ignores this character. So if the line I read in was a 10 bytes line, it now only writes back out a 9 byte line. This is a huge issue as the file I am working with has to be a fixed length. I know there is some encoding that can be done to make this work, but know very little about it. I would really appreciate some help on this.
Dim LINE_HOLDER As String = ""
Dim oFILE_input As System.IO.File
Dim oFILE_output As System.IO.File
Dim oWRITE As System.IO.StreamWriter
Dim oREAD As System.IO.StreamReader
oREAD = oFILE_input.OpenText(TextBox1.Text)
oWRITE = oFILE_output.CreateText("C:\FILE.TXT")
LINE_HOLDER = oREAD.ReadLine()
While oREAD.Peek <> -1
oWRITE.WriteLine(LINE_HOLDER)
RECORD_COUNTER = RECORD_COUNTER + 1
LINE_HOLDER = oREAD.ReadLine()
End While
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|