@@ -25,7 +25,8 @@ Example:
25
25
URLEncode("Test string $$") -- returns "Test+string+%24%24"
26
26
27
27
Example:
28
- put URLEncode("http://www.example.net/document.html") into newURL
28
+ local tGoodURL
29
+ put "http://www.example.net/" & URLEncode("A File Name with spaces.html") into tGoodURL
29
30
30
31
Parameters:
31
32
formString (string):
@@ -45,7 +46,21 @@ Letters and numbers (alphanumeric characters) are not transformed by the
45
46
characters is a percent sign followed by two <hexadecimal> digits. For
46
47
example, the <ASCII|ASCII value> of the <character> ~ is 126; the
47
48
hexadecimal equivalent of 126 is 7E. So wherever the <character> ~
48
- <a/>appears in the formString, it is converted to "%7E".
49
+ appears in the formString, it is converted to "%7E".
50
+
51
+ >*Note:* The URLEncode function does not conform to RFC3986. In order
52
+ > to produce a string that does conform to it, you would first encode
53
+ > the string to UTF-8 and then after performing URLEncode, replace all
54
+ > instances of "+" with "%20". For example:
55
+
56
+ function urlEncodeRFC pString
57
+ if pString is strictly a string then
58
+ put textEncode(pString,"UTF-8") into pString
59
+ end if
60
+ put URLEncode(pString) into pString
61
+ replace "+" with "%20" in pString
62
+ return pString
63
+ end urlEncodeRFC
49
64
50
65
References: post (command), function (control structure),
51
66
hexadecimal (glossary), encode (glossary), Escape key (glossary),
0 commit comments