InteractiveMind
asked on
translate into http character codes - 1.3
My string could potentially look something like this:
abc def/ghi__$jkl/0324aff
I need to pass this string to a web page (PHP), via GET.
But obviously, I can't just do:
http://domain/page.php?str=abc def/ghi__$jkl/0324aff
Because the parameter can only contain a-z, A-Z, and 0-9.
So, in Java 1.3 here, I need to turn that string into something which is valid ....
Any ideas?
Thanks
abc def/ghi__$jkl/0324aff
I need to pass this string to a web page (PHP), via GET.
But obviously, I can't just do:
http://domain/page.php?str=abc def/ghi__$jkl/0324aff
Because the parameter can only contain a-z, A-Z, and 0-9.
So, in Java 1.3 here, I need to turn that string into something which is valid ....
Any ideas?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Non-deprecated:
String escapedParam = java.net.URLEncoder.encode (yourParam , "UTF-8");
String escapedParam = java.net.URLEncoder.encode
:-)
ASKER
Thanks