How to encode urls with URLEncoder
import java.net.URLEncoder;
String encodedUrl = URLEncoder.encode("Encode me the string", "UTF-8");
String encodedUrl = URLEncoder.encode("Encode me the string", "UTF-8");
You must supply the second parameter UTF-8 otherwise that method is deprecated.
Use URLDecoder.decode("Blah", "UTF-8") to decode urls.
References
[Click to add or edit comments])
Please prepend comments below including a date