Here is a function that you can run to illustrate the issue. In brief, for integers and decimals, unless the value is first turned into a string using toString(), it will become null when encoded for a URL.
void Bugs.encodeUrlBug()
{
// this function illustrates a bug whereby integers become null values when processed by the encodeUrl() function
// the solution is to turn all numbers into strings before using the encodeUrl() function
parametersMap = Map();
stringVariable = "a string parameter";
integerVariable = 12345;
decimalVariable = 678.90;
parametersMap.put("String", stringVariable);
parametersMap.put("Integer", integerVariable);
parametersMap.put("IntegerToString", integerVariable.toString());
parametersMap.put("Decimal", decimalVariable);
parametersMap.put("DecimalToString:", decimalVariable.toString());
// encode the parametersMap
encodedMap = map();
for each k in parametersMap.keys()
{
encodedMap.put("encoded " + k.toString(), encodeurl(parametersMap.get(k)));
}
info parametersMap;
info "---";
info encodedMap;
/// see that the integer and decimal values, when encoded, become null unless they are first transformed into Strings
}