|
-
Jun 3rd, 2005, 10:33 AM
#1
Thread Starter
Lively Member
encoding problem
i'm converting a string ,letter by letter into ascii codes, adding 3 to each ascii code and converting them back into string.
so "hello" would become "khoor"
Im saving this to a textfile.
The problem is that when im reading it back from the textfile and converting it back to the original string the code puts two little squares after it.
Dim fso As New FileSystemObject
Dim s, stext As String
Dim objTextStream
ArticleText.Text = ""
s = Data.Files(1)
Set objTextStream = fso.OpenTextFile(s, 1)
stext = objTextStream.ReadAll
so my stext has two squares at the end :0(
does anyone know why?
thanks
kati
-
Jun 3rd, 2005, 10:49 AM
#2
Junior Member
Re: encoding problem
I am not positive. But, I believe the last 2 squares are the EOF (end-of-file) marker or possibly a carriage return/linefeed (vbCrLf) maybe.
Hope that helps
-
Jun 3rd, 2005, 10:53 AM
#3
Thread Starter
Lively Member
Re: encoding problem
thanks.
any idea how to get rid of them?
trim() doesnt work
thanks
Kati
-
Jun 3rd, 2005, 10:56 AM
#4
Junior Member
Re: encoding problem
You can easily chop off the last 2 chars as such:
Debug.Print Left(sText, Len(sText) - 2)
That funky char might be treated as 1 char though, its been a while since I dealt with it. Just change to - 1 instead if that is the case. Good luck.
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
|