Here you can find the source of getURLEncodeStr(String url)
public static String getURLEncodeStr(String url)
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { public static String getURLEncodeStr(String url) { try {//from w w w.ja v a 2 s .c o m url = URLEncoder.encode(url, "utf-8"); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block } return url; } }