Java tutorial
//package com.java2s; import java.net.URLEncoder; public class Main { /** * url Encode * * @param content * @return */ public static String getUrlEncodeString(String content) { String content_ = content; try { content_ = URLEncoder.encode(content, "utf-8").replace("+", "%20"); } catch (Exception e) { content_ = content; } return content_; } }