import org.apache.commons.codec.EncoderException;
import org.apache.commons.codec.net.URLCodec;
public static String encodeURL(String url) {
try {
return new URLCodec().encode(url);
} catch (EncoderException e) {
return null;
}
}
or
String inputEnc= URLEncoder.encode(input,"UTF-8"); // jakarta-commons/commons-codec.jar
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment