CFLib.org – Common Function Library Project

fullUrlEncode(str)

Last updated February 11, 2015

author

Umbrae

Version: 2 | Requires: CF5 | Library: StrLib

Description:
This function gives the fully escaped URL encoding of a string.

Return Values:
Returns a string.

Example:

#fullurlencode('blah')#
<br>
#URLDecode(fullurlencode('this shows the compatibility with URLDecode and special characters. ^!*(-{}|'))#

Parameters:

Name Description Required
str String to encode. Yes

Full UDF Source:

/**
 * Give the fully escaped URL encoding of a string.
 * 
 * @param str 	 String to encode. (Required)
 * @return Returns a string. 
 * @author Umbrae (umbrae@gmail.com) 
 * @version 1, August 2, 2005 
 */
function fullurlencode(str) {
	var encstr="";
	var len=len(str);
	var i=1;
	for(i=1; i LTE len; i=i+1) {
		var char = FormatBaseN(Asc(Mid(str,i,1)),16);
		if(len(char) == 1) char = "0" & char;
		encstr = encstr & "%" & char;
	}
	return encstr;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson