public static String encodeQuery ( String query , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( query , encoding , HierarchicalUriComponents . Type . QUERY ) ; }
Encodes the given URI query with the given encoding .