in Java
https%3A%2F%2Fmywebsite%2Fdocs%2Fenglish%2Fsite%2Fmybook.do%3Frequest_type
These chords
https://mywebsite/docs/english/site/mybook.do&request_type
I'd like to change it like this.
class StringUTF
{
public static void main(String[] args)
{
try{
String url =
"https%3A%2F%2Fmywebsite%2Fdocs%2Fenglish%2Fsite%2Fmybook.do" +
"%3Frequest_type%3D%26type%3Dprivate";
System.out.println(url+"Hello World!------->" +
new String(url.getBytes("UTF-8"),"ASCII"));
}
catch(Exception E){
}
}
}
I tried it like this, but it didn't work. How shall I do it?
java url-encoding
String result = java.net.URLDecoder.decode(url, "UTF-8");
You can do it in this way.
© 2024 OneMinuteCode. All rights reserved.