I've got String Ruby On Rails
, it should be converted to Ruby%20On%20Rails
, but URLEncoder
says Ruby+On+Rails
. This is my try:
String encoded = URLEncoder.encode("Ruby On Rails");
System.out.println(encoded);
Is it happening because encode()
method is deprecated?