Here you can find the source of encodeDoublePercent(String input)
public static String encodeDoublePercent(String input)
//package com.java2s; // The contents of this file are subject to the Mozilla Public License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { public static String encodeDoublePercent(String input) { if (input.contains("%")) { input = input.replaceAll("%", "%25"); }// w ww .ja v a 2 s.co m return encode(input); } public static String encode(String input) { try { return URLEncoder.encode(input, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return null; } } }