System.out.println(str);
    public static String encode(String str, String encoding)        throws UnsupportedEncodingException {        int l = str.length();        boolean needsSpaceEncoding = false;        System.out.println(str);        for (int i = 0; i < l; i++) {            char c = str.charAt(i);            if (c == ' ') {                needsSpaceEncoding = true;            } else if (!(((c >= 'a') && (c <= 'z'))                || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')))) {                if (encode != null) {                    try {                        return (String) encode.invoke(null, new Object[] { str,                                encoding });                    } catch (IllegalAccessException e) {                        // don't keep trying if we get one of these                        encode = null;                        System.err.println("UrlEncoded: Can't access JDK 1.4 encode method ("                            + e + "). Using deprecated version from now on.");                    } catch (InvocationTargetException e) {                        // this can only be a UnsupportedEncodingException:                        Throwable ex = e.getTargetException();                        if (ex instanceof UnsupportedEncodingException)                            throw (UnsupportedEncodingException) ex;                    }                }                return URLEncoder.encode(str);            }        }        if (needsSpaceEncoding) {            return str.replace(' ', '+');        }        return str;    }