code: public static String urlEncode(String part) {
  		try {
  			return URLEncoder.encode(part, Charsets.UTF_8_NAME);
  		} catch (UnsupportedEncodingException ignored) { // NOSONAR
  			// this exception is only for detecting and handling invalid inputs
  			return null;
  		}
  	}
docs: URL 编码, Encode默认为UTF-8.
  
  转义后的URL可作为URL中的参数