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