From 8d8463674f6ee59d2ce975e760442e52a7914500 Mon Sep 17 00:00:00 2001 From: visionmercer <62051836+visionmercer@users.noreply.github.com> Date: Sat, 21 May 2022 00:41:16 +0200 Subject: [PATCH] Create urlencode.bm --- urlencode.bm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 urlencode.bm diff --git a/urlencode.bm b/urlencode.bm new file mode 100644 index 0000000..f44e516 --- /dev/null +++ b/urlencode.bm @@ -0,0 +1,16 @@ +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 + buf$ = buf$ + "%" + Hex$(Asc(char$)) + End Select + Next i + urlencode$ = buf$ +End Function