Existe una forma muy simple para codificar un String de URL en UTF-8:
Al método donde agreguen estas lineas deberán agregar
throws UnsupportedEncodingException

try{
String encodedurl = URLEncoder.encode(url.toString(),"UTF-8");
System.out.println(encodedurl);
}catch(UnsupportedEncodingException e){
System.err.println(e);
}
Al método donde agreguen estas lineas deberán agregar
throws UnsupportedEncodingException