ascii text

  • Thread starter Thread starter poldoj
  • Start date Start date
P

poldoj

Hi all, I have a very strange problem with a text file. I have write some
lines as ascii text from my vb application to a text file. If I open the
text file it looks like normal text but if I read it some caracters became
strange (ascii text). I want to convert this file in normal text, I tried
ctype, cstr, tostring, directcast without success. I have also read the file
line by line, ctype the line, put the lines in an array, delete the file,
create a new one and write the array, no luck :(
Thanks
 
Poldoj,

Internal your Strings are in unicode which are 16bits, when you write it too
ASCII which is 7bits, than probably you loose information, can that be the
problem?

Cor
 
poldoj said:
Hi all, I have a very strange problem with a text file. I have write some
lines as ascii text from my vb application to a text file. If I open the
text file it looks like normal text but if I read it some caracters became
strange (ascii text). I want to convert this file in normal text, I tried
ctype, cstr, tostring, directcast without success. I have also read the
file line by line, ctype the line, put the lines in an array, delete the
file, create a new one and write the array, no luck :(


"Post your code!"
 
Never mind dear friends, I got tired and deleted this part of code from my
application. Im trying another solution where ascii text is not involved.
Thanks again and sorry :(
 
Dim SourceText As String
Dim DestText As String
Dim unicodeEncoder As New System.Text.UnicodeEncoding

DestText =
unicodeEncoder.GetString(unicodeEncoder.Convert(unicodeEncoder.ASCII,
unicodeEncoder.Unicode, unicodeEncoder.GetBytes(SourceText)))
Hi all, I have a very strange problem with a text file. I have write some
lines as ascii text from my vb application to a text file. If I open the
text file it looks like normal text but if I read it some caracters became
strange (ascii text). I want to convert this file in normal text, I tried
ctype, cstr, tostring, directcast without success. I have also read the file
line by line, ctype the line, put the lines in an array, delete the file,
create a new one and write the array, no luck :(
Thanks

--

Best,
_____________
Bharat Sharma

* TEN Technologies.
* Official Web: _www.ten-technologies.com_
<http://www.ten-technologies.comemail/>
Personal Web: _www.bharatsharma.net_ <http://www.bharatsharma.net/>
 
Back
Top