Oem to Ansi

  • Thread starter Thread starter Rastarizer
  • Start date Start date
R

Rastarizer

I got an OEM file and I use a StreamReader to read it but I got a problem
that the file may got some characters that StreamReader can not read so it
reads only some data of it.

eg.

Dim StreamToDisplay As New StreamReader("C:\OEMFILE.DAT", _
Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage))
Dim aLine As String
Do
aLine = StreamToDisplay.ReadLine
TextBox1.Text += aLine + Chr(13) + Chr(10)
Loop Until aLine = Nothing
StreamToDisplay.Close()

When it ends then I see at the TextBox that the file is has not be read
right. I tried the FileOpen method but the same problem occured.
The encoding is correct cause when I open the OEMFILE.DAT through the
Notepad and simple save it with the same name then the StreamReader can read
it correct. But the point is that it must be done without the help of the
Notepad.

Any help ?
 

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

Back
Top