-
Oct 27th, 2010, 12:02 PM
#1
Thread Starter
Hyperactive Member
winsock html ascii extended
Hi,
Im using this function to convert data before sending with winsock
Code:
Public Function URLEncode(ByVal Txt As String) As String
Dim i As Double
Dim ch As String
Dim ch_asc As Integer
Dim result As String
SetSafeChars
result = ""
For i = 1 To Len(Txt)
' Translate the next character.
ch = Mid$(Txt, i, 1)
ch_asc = Asc(ch)
If ch_asc = vbKeySpace Then
' Use a plus.
result = result & "+"
ElseIf m_SafeChar(ch_asc) Then
' Use the character.
result = result & ch
Else
' Convert the character to hex.
result = result & "%" & Right$("0" & Hex$(ch_asc), 2)
End If
Next i
URLEncode = result
End Function
If i use an ascii like █ winsock will send the data only till this char █...
any ideas how to fix that?
Cheers
Thanks for helping me out.
-
Oct 27th, 2010, 12:30 PM
#2
Re: winsock html ascii extended
How do you know it's not sending ? maybe it is sending, but the text box (or whatever object you are using) does not display after it ?
What is the code you use on the receiving side, and how to you display the text ?
-
Oct 27th, 2010, 12:59 PM
#3
Thread Starter
Hyperactive Member
Re: winsock html ascii extended
yes you are correct, the RTF box is not accepting it...and before i send on winsock i have to convert to html with the code so it all gets sent..
Im using this in the RTF box " ▄▄▄▓███▄▄ ▄▄██▓▄▄ ▄▄▄▓███▓▄ ▄▄▄▓████▄
▄▓████▀▀████▌▐██████▓▀▄▓████▀████▓▌ ▄▓████▀█████▓
▓████░▌ ▐██▓█▀ ▀█▌▀▀▀ ▓█████▌ ▐████▓ ▓█████▌ ▐█████"
For this i get: ???? ???? ????
hmmmm
Thanks for helping me out.
-
Oct 27th, 2010, 01:14 PM
#4
Re: winsock html ascii extended
Well, show us the code you are using to send the data, and also to receive the data.
Also, binary data cannot be displayed in text boxes or RTF, you should convert to HEX...
And to send the binary data, the best way is to convert it to Base64, and convert back to binary on the receiving side.
-
Oct 27th, 2010, 03:31 PM
#5
Thread Starter
Hyperactive Member
Re: winsock html ascii extended
oki doki ...
so i managed to load the data into TextBox ... not into RTF ... strange? hmmm
what i did is change the font to Terminal...and i managed to load the file containing :
▄▄▓███▄▄ ▄▄██▓▄▄ ▄▄▄▓███▓▄ ▄▄▄▓████▄
▄▓████▀▀████▌▐██████▓▀▄▓████▀████▓▌ ▄▓████▀█████▓
▓████░▌ ▐██▓█▀ ▀█▌▀▀▀ ▓█████▌ ▐████▓ ▓█████▌ ▐█████"
so what im doing next is sending the TextBox.Text into winsock.
im only doing a send process within winsock...i do a POST command
the text sends nicely..but at the the other end (webpage html) i get :
ÛÛÛ± ßß Üß²Ý
ÛÛÛÛÛ° ² ÜÛ²ÛÝ
ÛÛÛÛÛÛÛ ²Ü ²Û²Û²
²Ü ÛÛÛÛÛÛÛ ° ²ßÜ ²Û°Û²°
²ßÜ °Û °ÛÛÛÛÛÛÛ Ý²² ²Û²Û² ° ÜÜ
Û²ÛÜ ² ÛÛÛÛÛ ÛÛÛÛÛÛÛÛ Ü ²ÜÛ² Û²Û² ÜÜܲ²²ßß
²Û²Û² ܲ ÛÛÛÛÛ ÛÛÛÛ±±ÛÛÛÛ ²Ü ²ÜÛ²ÛÛßÜßß²Üßß
²Û°Û² Üß² ÛÛÛÛÛÛÛ ÛÛÛ±±±ÛÛÛÛ ß²²ÜßÛÛÛܲ
im kinda lost now :S
Thanks for helping me out.
-
Nov 8th, 2010, 08:15 PM
#6
Thread Starter
Hyperactive Member
Re: winsock html ascii extended
any ideas what could i do to solve that?
cheers
Thanks for helping me out.
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
|