public static String queryEncode ( String query , Charset charset ) { return encodeReserved ( query , FragmentType . QUERY , charset ) ; /* spaces will be encoded as 'plus' symbols here, we want them pct-encoded */ // return encoded.replaceAll("\\+", "%20"); }
Uri Encode a Query Fragment .