Here you can find the source of encodeParams(ArrayList
public static ArrayList<String> encodeParams(ArrayList<String> params) throws UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; public class Main { public static ArrayList<String> encodeParams(ArrayList<String> params) throws UnsupportedEncodingException { ArrayList<String> encoded = new ArrayList<String>(); for (String string : params) { String[] parts = string.split("="); if (parts.length == 2) { encoded.add(parts[0] + "=" + URLEncoder.encode(parts[1], "UTF-8")); } else { encoded.add(string);/*from w w w . jav a2s. c o m*/ } } return encoded; } }