Here you can find the source of percentEncode(String value)
private static String percentEncode(String value) throws UnsupportedEncodingException
//package com.java2s; /*/*from w ww . j a va 2 s . c om*/ * Copyright 2015 Aliyun.com All right reserved. This software is the * confidential and proprietary information of Aliyun.com ("Confidential * Information"). You shall not disclose such Confidential Information and shall * use it only in accordance with the terms of the license agreement you entered * into with Aliyun.com . */ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { private static final String encode = "UTF-8"; private static final String EMPTY = ""; private static String percentEncode(String value) throws UnsupportedEncodingException { return value == null ? EMPTY : URLEncoder.encode(value, encode); } }