Encode a given URL using percent-encoding.
https://www.example.com/search?q=python
String url = "https://www.example.com/search?q=python";
String encodedUrl = URLEncoder.encode(url, "UTF-8");
System.out.println(encodedUrl);  // https%3A%2F%2Fwww.example.com%2Fsearch%3Fq%3Dpython