🎓 Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (178K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
URL Decoder Online
URL Decoder is an online tool for decoding URLs. Note that, our tool assumes that the input is encoded using the UTF-8 encoding scheme. The worldwide web consortium recommends using the UTF-8 encoding scheme when working with URLs.Check out URL Encoder Online tool at URL Encoder Online
URL Decode Example
Decoded URL input:
https%3A%2F%2Fwww.javaguides.net%2Fp%2Furl-decoder-online.htmlEncoded URL output:
https://www.javaguides.net/p/url-decoder-online.html
What is URL Decoding and why is it required?
URL decoding is the inverse process of URL encoding. It is used to parse query strings or path parameters passed in URLs. It is also used to decode HTML form parameters that are submitted with application/x-www-form-urlencoded MIME format
URLs, as you might know, can only contain a limited set of characters from the US-ASCII character set. These characters include Alphabets (A-Z a-z), Digits (0-9), hyphen (-), underscore (_), tilde (~), and dot (.). Any character outside this allowed set is encoded using URL encoding or Percent encoding.
This is why it becomes necessary to decode query strings or path parameters passed in URLs to get the actual values.
Decode URL in JavaScript
Let's first encode using the decodeURIComponent() method and then decode it using the encodeURIComponent() function.
var uri = "https://javaguides.net/my test.html?name=ram&age29";
console.log("before encode :: " + uri);
var encode = encodeURIComponent(uri);
console.log("after encode :: " + encode);
var decode = decodeURIComponent(encode);
console.log("after decode :: " + decode);
Output:
before encode :: https://javaguides.net/my test.html?name=ram&age29
after encode :: https%3A%2F%2Fjavaguides.net%2Fmy%20test.html%3Fname%3Dram%26age29
after decode :: https://javaguides.net/my test.html?name=ram&age29
Read more about how to encode and decode URL in JavaScript in a blog post at Encode and Decode URL in JavaScript.
URL Decode in Java
In Java, URLDecoder class provides a decode() method which decodes an application/x-www-form-urlencoded string using a specific encoding scheme.
The below program demonstrates the usage of the decode() method:
package net.javaguides.network;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
public class URLDecoderExample {
public static void main(String[] args) throws UnsupportedEncodingException, MalformedURLException {
// base URL
String baseurl = "https://www.javaguides.net/search?q=";
// String to be encoded
String query = "core+java+tutorial";
System.out.println("URL without encoding :");
URL url = new URL(baseurl + query);
System.out.println(url);
// encode() method
System.out.println("URL after encoding :");
String encodedStr = URLEncoder.encode(query, "UTF-8");
url = new URL(baseurl + encodedStr);
System.out.println(url);
// decode url process
System.out.println("Encoded URL :");
System.out.println(baseurl + encodedStr);
// decode() method
System.out.println("Decoded URL :");
String decode = URLDecoder.decode(encodedStr, "UTF-8");
System.out.println(baseurl + decode);
}
}
Output:
URL without encoding :
https://www.javaguides.net/search?q=core+java+tutorial
URL after encoding :
https://www.javaguides.net/search?q=core%2Bjava%2Btutorial
Encoded URL :
https://www.javaguides.net/search?q=core%2Bjava%2Btutorial
Decoded URL :
https://www.javaguides.net/search?q=core+java+tutorial
Our example uses UTF-8 encoding for decoding the URLs. You should always use UTF-8 to avoid incompatibilities with other systems. That is what the world wide web consortium recommends.
Check out how to encode and decode URLs in Java at Java URLEncoder and URLDecoder Class Examples
URL Encode Online Tool
My Top and Bestseller Udemy Courses. The sale is going on with a 70 - 80% discount. The discount coupon has been added to each course below:
Build REST APIs with Spring Boot 4, Spring Security 7, and JWT
🆕 High-Demand
80–90% OFF
[NEW] Learn Apache Maven with IntelliJ IDEA and Java 25
🆕 High-Demand
80–90% OFF
ChatGPT + Generative AI + Prompt Engineering for Beginners
🚀 Trending Now
80–90% OFF
Spring 7 and Spring Boot 4 for Beginners (Includes 8 Projects)
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Building Real-Time REST APIs with Spring Boot - Blog App
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Building Microservices with Spring Boot and Spring Cloud
🌟 Top Rated
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Java Full-Stack Developer Course with Spring Boot and React JS
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Build 5 Spring Boot Projects with Java: Line-by-Line Coding
🌟 Top Rated
80–90% OFF
Testing Spring Boot Application with JUnit and Mockito
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Spring Boot Thymeleaf Real-Time Web Application - Blog App
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Master Spring Data JPA with Hibernate
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Spring Boot + Apache Kafka Course - The Practical Guide
🎓 Student Favorite
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Comments
Post a Comment
Leave Comment