Languages
[Edit]
EN

Java - validate encoded URI component characters

7 points
Created by:
Burhan-Boyce
458

In this short article, we would like to show how to check if some text is correctly encoded URI component using Java.

Note: to know what characters should be escaped encoding URI component check this article.

Quick solution:

 

Optimal solution

Edit

This section contains a solution that does not use regular expressions what makes the below source code optimal (faster in executing).

Program.java file:

URIComponentUtils.java file:

See also

Edit
  1. Java - encodeURIComponent equivalent in JavaScript

  2. Java - decodeURIComponent equivalent in JavaScript

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join