UrlEncode ( text )
Rate this function: Average rating: 3.5 (11 votes) Discuss this Custom Function
Jeremiah Small, Soliant Consulting
http://jsmall.us
Converts illegal and reserved URL characters into URL-legal hex code.
Sample Input:
| "http://www.database.com/page.php?field=" & UrlEncode ( "¶ \"!#$%&'()*+,-./:;<=>?@[\\]^`{|}" ) |
|
Sample Output:
| http://www.database.com/page.php?field=%0D%20%22%21%23%24%25%26%27%28%29%2A%2B%2C%2D%2E%2F%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D |
|
Description:
A complete table of hexadecimal codes can be found here http://www.december.com/html/spec/ascii.html
Be aware that curly quotes (single and double) are high-ascii, and will not be converted with this function. If you need quotes, make sure your input is with straight quotes.
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:
|
Newest Custom Functions:
| 1. |
GetResultParameter( ParameterName ) |
| |
(Wed, Aug 25, 8:32am) |
| 2. |
GetListParameter ( ParameterList ; ParameterName ) |
| |
(Wed, Aug 25, 8:25am) |
| 3. |
Standard_Deviation( Field ; MaxLoopCount ; StartIndex ; StdDeviation ; ArithMeanValue ) |
| |
(Tue, Aug 24, 10:57am) |
| 4. |
Arithmetic_Mean ( Field ; MaxLoopCount ; StartIndex ; MeanValue ) |
| |
(Tue, Aug 24, 10:51am) |
| 5. |
Age ( Birth; theDate; Format ) |
| |
(Fri, Aug 20, 9:50am) |
| 6. |
Power ( x ; y ) |
| |
(Thu, Aug 19, 5:56am) |
| 7. |
portal.rowCount ( _name ) |
| |
(Sun, Aug 15, 2:41pm) |
| 8. |
PostPer_Day ( Post; startDate ; finishDate ; returnType ) |
| |
(Sat, Aug 14, 2:02pm) |
 |
|
The following version adds in a few more important substitutions...
/* See http://www.faqs.org/rfcs/rfc2368.html for mailto specifications
The following substitutions and their order are important. mailto: will fail without them.
Reserved characterss in a mailto: URL are "-", "&", and "?"
Must escape the % first, before you start adding them in.
Then do spaces and returns.
Stupify quotes and other stuff
Non-breaking space
Does not handle double quotes or tabs (%09)
Could add substitutions for all diacriticals and other less common characters */
Substitute (text;
["%"; "%25"];
[ " "; "%20"];
["¶"; "%0D"];
[ "!" ; "%21" ] ;
[ "$" ; "%24" ] ;
[ "(" ; "%28" ] ;
[ ")" ; "%29" ] ;
[ "*" ; "%2A" ] ;
[ "+" ; "%2B" ] ;
[ "." ; "%2E" ] ;
[ "=" ; "%3D" ] ;
["\“"; "%22"];
[ "\”"; "%22"];
["‘"; "%27"];
["’"; "%27"];
["'"; "%27"];
["…"; "..."];
["•"; "*"];
[ "-"; "%2D"];
["&"; "%26"];
["="; "%3D"];
["?"; "%3F"];
["#"; "%23"];
[","; "%2C"];
[ "/"; "%2F"];
[":"; "%3A"];
[";"; "%3B"];
[ "<"; "%3C"];
[ ">"; "%3E"];
["@"; "%40&quo
Tim Cimbura, Minneapolis, MN
May 01, 2010 7:59pm