Reputation: 1201
I have a simple
String abc = "réunion";
I should convert this string into the URL percent encoding - so I need:
String abc = "r%c3%a9union";
Any simple solution for this?
Upvotes: 1
Views: 4148
Reputation: 2135
Try this class:
java.net.URLEncoder
For example, for encoding as UTF:
import java.net.URLEncoder;
.....
String utf_encoded = URLEncoder.encode(url.toString(),"UTF-8");
Upvotes: 5