translate into http character codes - 1.3

Posted on 2006-04-22
Last Modified: 2010-03-31
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?

Question by:InteractiveMind
    LVL 86

    Accepted Solution

    String escapedParam =;
    LVL 25

    Author Comment

    that was easy :)

    LVL 86

    Expert Comment


    String escapedParam =, "UTF-8");
    LVL 86

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now