software/ncimappingtool/src/java/gov/nih/nci/evs/browser/utils/DataUtils.java
/*
     * To convert a string to the URL-encoded form suitable for transmission as
     * a query string (or, generally speaking, as part of a URL), use the escape
     * function. This function works as follows: digits, Latin letters and the
     * characters + - * / . _ @ remain unchanged; all other characters in the
     * original string are replaced by escape-sequences %XX, where XX is the
     * ASCII code of the original character. Example: escape("It's me!") //
     * result: It%27s%20me%21
     */
To convert a string to the URL-encoded form suitable for transmission as
a query string (or, generally speaking, as part of a URL), use the escape
function. This function works as follows: digits, Latin letters and the
characters + - * / . _ @ remain unchanged; all other characters in the
original string are replaced by escape-sequences %XX, where XX is the
ASCII code of the original character.
To convert a string to the URL - encoded form suitable for transmission as a query string ( or generally speaking as part of a URL ) use the escape function . This function works as follows : digits Latin letters and the characters + - * / . _ @ remain unchanged ; all other characters in the original string are replaced by escape - sequences %XX where XX is the ASCII code of the original character .
public static String htmlEntityEncode(String s) {
        StringBuilder buf = new StringBuilder(s.length());
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0'
                && c <= '9') {
                buf.append(c);
            } else {
                buf.append("&#").append((int) c).append(";");
            }
        }
        return buf.toString();
    }
public static String htmlEntityEncode ( String s ) { StringBuilder buf = new StringBuilder ( s . length ( ) ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' ) { buf . append ( c ) ; } else { buf . append ( "&#" ) . append ( ( int ) c ) . append ( ";" ) ; } } return buf . toString ( ) ; }
To convert a string to the URL-encoded form suitable for transmission as
 a query string (or, generally speaking, as part of a URL), use the escape
 function.
To convert a string to the URL - encoded form suitable for transmission as a query string ( or generally speaking as part of a URL ) use the escape function .