java - URLEncoder troubles -
i've got string ruby on rails
, should converted ruby%20on%20rails
, urlencoder
says ruby+on+rails
. try:
string encoded = urlencoder.encode("ruby on rails"); system.out.println(encoded);
is happening because encode()
method deprecated?
urlencoder doesn't uri encoding, application/x-www-form-urlencoded
, converts spaces +
signs. if want them converting %20
need uri encoding instead, such spring's uriutils.
Comments
Post a Comment