2022-09-19 01:27:48 +02:00
|
|
|
$if urlencode = undefined then
|
|
|
|
|
$let urlencode = defined
|
2022-05-21 00:41:16 +02:00
|
|
|
Function urlencode$ (strng$)
|
|
|
|
|
Dim buf$, char$
|
|
|
|
|
For i = 1 To Len(strng$)
|
|
|
|
|
char$ = Mid$(strng$, i, 1)
|
|
|
|
|
Select Case Asc(char$)
|
|
|
|
|
'Comment out next two lines if space should be %20 instead of +
|
|
|
|
|
Case 32
|
|
|
|
|
buf$ = buf$ + "+"
|
|
|
|
|
Case 48 TO 57, 65 TO 90, 97 TO 122, 45, 46, 95
|
|
|
|
|
buf$ = buf$ + char$
|
|
|
|
|
Case Else
|
2022-05-21 08:14:58 +02:00
|
|
|
buf$ = buf$ + "%" + Right$("0" + Hex$(Asc(char$)), 2)
|
2022-05-21 00:41:16 +02:00
|
|
|
End Select
|
|
|
|
|
Next i
|
|
|
|
|
urlencode$ = buf$
|
|
|
|
|
End Function
|
2022-09-19 01:27:48 +02:00
|
|
|
$end if
|