We are replacing all the javascript buttons to custom VF buttons.
Have used encodeURIComponent methods in Javascript, unable to find the equivalent salesforce method
Have checked EncodingUtil Class in salesforce but that doesn't seem to solve the purpose ?
Input :
var uri = "http://w3schools.com/my test.asp?name=ståle&car=saab";
var res = encodeURIComponent(uri);
Output :
http%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab
Thanks for the help !
Best Answer
Did you check:
Reference: EncodingUtil
Example:
Result: