Link to home
Start Free TrialLog in
Avatar of InteractiveMind
InteractiveMindFlag for United Kingdom of Great Britain and Northern Ireland

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
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of InteractiveMind

ASKER

that was easy :)

Thanks
Non-deprecated:

String escapedParam = java.net.URLEncoder.encode(yourParam, "UTF-8");
:-)