Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { public static String urlEncode(String content, String charsetName) { try { return URLEncoder.encode(content, charsetName); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return ""; } }