Java tutorial
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { public static String urlEncoderStr(String string) { try { return URLEncoder.encode(string, "utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return string; } }