ascii text

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
 
C

Cor Ligthert

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
 
H

Herfried K. Wagner [MVP]

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!"
 
P

poldoj

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 :(
 
B

Bharat Sharma

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/>
 

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

Top