Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing special chars from URL

Tags:

java

android

I want to remove any of special characters in a url. I tried the StringEscapeUtils class to remove special chars. But no use of that. For eg: http%3A%2Ffeeds.feedburner.com%2FNdtvNews-TopStories . Any of ideas are welcome

like image 623
Srinivas Avatar asked Feb 09 '12 05:02

Srinivas


People also ask

How do you change the special characters in a URL?

URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits. URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.

Why is there a %20 in my URL?

A space is assigned number 32, which is 20 in hexadecimal. When you see “%20,” it represents a space in an encoded URL, for example, http://www.example.com/products%20and%20services.html.

Can URL have special characters?

Some characters cannot be part of a URL (for example, the space) and some other characters have a special meaning in a URL. In HTML forms, the character = is used to separate a name from a value.


1 Answers

I have used java.net.URLDecoder.decode("String") in the past. Should still hold.

like image 197
manocha_ak Avatar answered Nov 01 '22 19:11

manocha_ak