RE:caracteres en url en VB
Hola! Realmente no se que hace la funcion urlencode, pero quizas el codigo de ejemplo que te paso te de una solucion.
Para probarlo en un form agrega 2 botones y 3 textbox, sin cambiarles los nombres por defecto, y luego en la seccion general del form pega el siguiente codigo:
Private Const MAX_PATH As Long = 260
Private Const ERROR_SUCCESS As Long = 0
'Treat entire URL param as one URL segment
Private Const URL_ESCAPE_SEGMENT_ONLY As Long = &H2000
Private Const URL_ESCAPE_PERCENT As Long = &H1000
Private Const URL_UNESCAPE_INPLACE As Long = &H100000
'escape #'s in paths
Private Const URL_INTERNAL_PATH As Long = &H800000
Private Const URL_DONT_ESCAPE_EXTRA_INFO As Long = &H2000000
Private Const URL_ESCAPE_SPACES_ONLY As Long = &H4000000
Private Const URL_DONT_SIMPLIFY As Long = &H8000000
'Converts unsafe characters,
'such as spaces, into their
'corresponding escape sequences.
Private Declare Function UrlEscape Lib "shlwapi" _
Alias "UrlEscapeA" _
(ByVal pszURL As String, _
ByVal pszEscaped As String, _
pcchEscaped As Long, _
ByVal dwFlags As Long) As Long
'Converts escape sequences back into
'ordinary characters.
Private Declare Function UrlUnescape Lib "shlwapi" _
Alias "UrlUnescapeA" _
(ByVal pszURL As String, _
ByVal pszUnescaped As String, _
pcchUnescaped As Long, _
ByVal dwFlags As Long) As Long
Private Sub Form_Load()
Text1.Text = "http://www.lawebdelprogramador.com/news/new.php?id=96&texto=Visual%20Basic%20Avanzado"
Text2.Text = ""
Text3.Text = ""
Command1.Caption = "Encode"
Command2.Caption = "Decode"
End Sub
Private Sub Command1_Click()
Dim sUrl As String
Dim sUrlEsc As String
'use the original string in Text1 for
'demo, and show encoded results in Text2
sUrl = Text1.Text
sUrlEsc = EncodeUrl(sUrl)
Text2.Text = sUrlEsc
End Sub
Private Sub Command2_Click()
Dim sUrl As String
Dim sUrlUnEsc As String
'use the encoded string in text2 for
'demo, and show decoded results in Text3
sUrl = Text2.Text
sUrlUnEsc = DecodeUrl(sUrl)
Text3.Text = sUrlUnEsc
End Sub
Private Function EncodeUrl(ByVal sUrl As String) As String
Dim sUrlEsc As String
Dim dwSize As Long
Dim dwFlags As Long
If Len(sUrl) > 0 Then
sUrlEsc = Space$(MAX_PATH)
dwSize = Len(sUrlEsc)
dwFlags = URL_DONT_SIMPLIFY
If UrlEscape(sUrl, _
sUrlEsc, _
dwSize, _
dwFlags) = ERROR_SUCCESS Then
EncodeUrl = Left$(sUrlEsc, dwSize)
End If 'If UrlEscape
End If 'If Len(sUrl) > 0
End Function
Private Function DecodeUrl(ByVal sUrl As String) As String
Dim sUrlUnEsc As String
Dim dwSize As Long
Dim dwFlags As Long
If Len(sUrl) > 0 Then
sUrlUnEsc = Space$(MAX_PATH)
dwSize = Len(sUrlUnEsc)
dwFlags = URL_DONT_SIMPLIFY
If UrlUnescape(sUrl, _
sUrlUnEsc, _
dwSize, _
dwFlags) = ERROR_SUCCESS Then
DecodeUrl = Left$(sUrlUnEsc, dwSize)
End If 'If UrlUnescape
End If 'If Len(sUrl) > 0
End Function
Por lo que pude probar esto te saca el caracter %
No se si es lo que buscas, pero bueno...espero te sirva.Saludos