Here you can find the source of encodeMap(Map map, String enc)
public static void encodeMap(Map map, String enc)
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Map; import java.util.Set; public class Main { public static void encodeMap(Map map, String enc) { if (null != map) { Set<String> keySet = map.keySet(); for (String key : keySet) { if (key.equals("sign") || key.equals("sign_type")) { continue; } else { try { map.put(key,//from ww w.j a v a 2s . c o m URLEncoder.encode(map.get(key) + "", enc)); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } } } } }