URLEncodedFormat behavior
I have written a function which is located in a CFC. The function takes two input parameters (the url stem, the URL structure). For some reason I can't get the function to actually generate URL encoded URLs. I have tested the URLEcondedFormat function in other functions and has no issues. For this function I don't know why it doesn't seem to work. Any ideas.
<cffunction name="constructUrl" returntype="string">
<cfargument name="baseUrl" type="string" required="true" />
<cfargument name="urlParams" type="struct" required="true" />
<cfset var param = "" />
<cfset var flag = "?" />
<cfset var firstParam = "true" />
<cfloop collection="#urlParams#" item="param">
<cfif firstParam IS "false">
<cfset flag = "&" />
</cfif>
<cfset baseUrl = baseUrl & flag & param & "=" & URLEncodedFormat(Trim(#urlParams[param]#)) />
<cfset firstParam = "false" />
</cfloop>
<cfreturn baseUrl />
</cffunction>
