URL-encodeing data for use in query-strings where =, &, ? and ; are encoded in addition to standard URL-encoding?

Is there a way to URL-encode data for use in query-strings where =, &, ? and ; are encoded in addition to standard URL-encoding? This means that for example a company name called "Company & Co" is encoded as "Company%20%26%20Co" Remember that we are talking about URL-query-encoding, not Character-encoding like Unicode, latin1 etc.

RE: URL-encodeing data for use in query-strings where =, &, ? and ; are encoded in addition to standard URL-encoding?

Hello Morten, 

Not sure how/where you are trying to do this but if you are using crmscripts you can just .urlEncode() your string. 
Example:

#setLanguageLevel 3;

String url = "Company & Co";
printLine(url.urlEncode());

Result

If you pass this to another CRMscript (?) you can use .urlDecode() on the receiving end as well :)

//Eivind

By: Eivind Johan Fasting 15 Jan 2021