Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a amateur and I am working on a private thing for fun, for my program I need to be able to copy text from a .jpg file which have been converted to a .txt file.

Here is a part of what the .txt file contains
"ùé :UÔÀï~˺‹árïºH9Šý lW`ÇöûhÝ ˜ÛÀU²ÝRù(5n"

this is what my string contains after streamreading it
"����������������������"

I dont want to decode the original text or anything i just want my string to match the containments of my .txt file.

My code is so clumsy you should thank me for not posting it.
Posted
Updated 20-Jul-14 14:03pm
v2
Comments
onelopez 20-Jul-14 21:48pm    
how did you encode it to begin with? do the opposite. If you encoded the image bytes to base64 then saved it to a text file, I recommend you read back to a memory stream, then decode it from base 64 and you got your original image. that's the logic for base64 encoding... not sure how you encoded your image to the text file.
Member 10959290 21-Jul-14 8:56am    
I did not encode it at all, I simply did as such
dim jpgfile as string = "D:\Content\Kryptering testmapp/fatman.jpg"
If System.IO.File.Exists(jpgfile) = True Then
System.IO.File.Copy(jpgfile, (insert new path and filename.txt))
MsgBox("file copied")
End If
now i have a copy of the jpg file in .txt format.
what i want to do with this is to get that exact strange text in a string like this
dim mystring as string
Using reader As StreamReader = New StreamReader(newstring)
mystring = reader.ReadToEnd
End Using
end sub
output of the string does not match the content of the txtfile, instead it contains a bunch of these :"�"
i want my string output to be "ùé :UÔÀï~˺‹árïºH9Šý lW`ÇöûhÝ ˜ÛÀU²ÝRù(5n" just as it is, not decoded or anything just in that plain text. Is it possible?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900