Here you can find the source of encode(String value)
static String encode(String value) throws UnsupportedEncodingException
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { static String encode(String value) throws UnsupportedEncodingException { if (value != null) { return URLEncoder.encode(value, "utf8"); } else {/* ww w .java 2 s. c o m*/ return ""; } } }