Java tutorial
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { public static String encodeString(String toEncode) { String toReturn = ""; try { toReturn = URLEncoder.encode(toEncode, "utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return toReturn; } }