Java tutorial
//package com.java2s; import java.net.URLEncoder; public class Main { public static String transform(String str) { String strUTF8 = null; try { strUTF8 = URLEncoder.encode(str, "UTF-8"); } catch (Exception e) { e.printStackTrace(); } return strUTF8; } }