Quote from
emo on September 15, 2021, 7:18 pm
Hi @shajujahra , you can create a VBScript function in menu>>option>>function library , like:
Function UrlEncode(url)
For i = 1 To Len(url)
n = Asc(Mid(url,i,1))
If (n >= 48 And n <= 57) Or (n >= 65 And n <= 90) _
Or (n >= 97 And n <= 122) Then
UrlEncode = UrlEncode & Mid(url,i,1)
Else
ChrHex = Hex(Asc(Mid(url,i,1)))
For j = 0 to (Len(ChrHex) / 2) - 1
UrlEncode = UrlEncode & "%" & Mid(ChrHex,(2*j) + 1,2)
Next
End If
Next
End Function
nbSetVar "resultado", UrlEncode("[%1]")
and from your program:
SetVar "[resultado]" ""
Call "UrlEncode" "http://your url to encode" "resultado"
Hi @shajujahra , you can create a VBScript function in menu>>option>>function library , like:
Function UrlEncode(url)
For i = 1 To Len(url)
n = Asc(Mid(url,i,1))
If (n >= 48 And n <= 57) Or (n >= 65 And n <= 90) _
Or (n >= 97 And n <= 122) Then
UrlEncode = UrlEncode & Mid(url,i,1)
Else
ChrHex = Hex(Asc(Mid(url,i,1)))
For j = 0 to (Len(ChrHex) / 2) - 1
UrlEncode = UrlEncode & "%" & Mid(ChrHex,(2*j) + 1,2)
Next
End If
Next
End Function
nbSetVar "resultado", UrlEncode("[%1]")
and from your program:
SetVar "[resultado]" ""
Call "UrlEncode" "http://your url to encode" "resultado"
luishp, Vadim and 4 other users have reacted to this post.
luishpVadimsghoshnbuCN_IcemandanitoAndy Marshman