all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
3
Task/URL-encoding/REALbasic/url-encoding-1.realbasic
Normal file
3
Task/URL-encoding/REALbasic/url-encoding-1.realbasic
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Dim URL As String = "http://foo bar/"
|
||||
URL = EncodeURLComponent(URL)
|
||||
Print(URL)
|
||||
13
Task/URL-encoding/REALbasic/url-encoding-2.realbasic
Normal file
13
Task/URL-encoding/REALbasic/url-encoding-2.realbasic
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Function URLEncode(URL As String, Exceptions As String = "") As String
|
||||
For i As Integer = 0 To 255
|
||||
If InStr(Exceptions, Chr(i)) > 0 Then Continue For i
|
||||
Dim char As String = Chr(127) + Right("00" + Hex(i), 2)
|
||||
URL = ReplaceAll(URL, Chr(i), char)
|
||||
If i = 47 Then i = 57
|
||||
If i = 64 Then i = 90
|
||||
If i = 96 Then i = 122
|
||||
If i = 126 Then i = 128
|
||||
Next
|
||||
URL = ReplaceAll(URL, Chr(127), "%")
|
||||
Return URL
|
||||
End Function
|
||||
Loading…
Add table
Add a link
Reference in a new issue