– Common Function Library Project


Last updated September 23, 2004


Anthony Petruzzi

Version: 1 | Requires: CF5 | Library: StrLib

There exists a problem in all versions of ColdFusion when you try to urldecode a string that contain a lone "%" such as "5% credit card". Usually the "%" will translate to "%25" if URLEncoded. However sometimes when programming you might not scope a variable so that you can get the value from either the URL or a FORM post. The problem is that if you get the variable from a FORM post, the string is not URLEncoded, this is where the bug comes into effect. In CF5 and below the uncoded "%" in the string will be returned as a blank, such as "5 credit card". However in CFMX this will cause an exception error. This UDF is a workaround for both CF5 and CFMX until a hotfix is available.

Return Values:
Returns a string.


<cfset variables.string = "5% credit card">


Name Description Required
string String to url decode. Yes

Full UDF Source:

 * This is a workaround for the URLDecode bug that exists in CF5 and CFMX.
 * @param string      String to url decode. (Required)
 * @return Returns a string. 
 * @author Anthony Petruzzi ( 
 * @version 1, September 23, 2004 
function fixURLDecode(string){
    return URLDecode(ReReplaceNoCase(string, "%([^A-F0-9{2}])", "%25\1", "ALL"));


Latest Additions

Raymond Camden added
November 04, 2017

Leigh added
May 11, 2016

Raymond Camden added
May 10, 2016

Kevin Cotton added
May 05, 2016

Raymond Camden added
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson