Drupal 7 url with hex code for special characters? The URLs for a Drupal 7 site are like the following ones: 


http://example.com/drupal7/?q=node/1#overlay=%3Fq%3Dnode%252Fadd%252Farticle
http://example.com/drupal7/?q=node/1#overlay=%3Fq%3Dadmin%252Fconfig%252Fcontent%252Fformats


I am into module development and this is quite irritating. How do I display the special characters, the "slashes/", "#", "&amp;" symbols that have been converted to hexadecimal codes?
You can use the following snippet.

$decoded_url = rawurldecode(rawurldecode($url));


For example, for the second URL, the code returns http://example.com/drupal7/?q=node/1#overlay=?q=admin/config/content/formats.

That URL anyway is not usable as it is, as it would be wrongly parsed. For example, if on my browser I enter http://tero.local/dr72/?q=node/1#overlay=?q=admin/config/content/formats (tero.local is the local name used from my computer), what I get is the following page.



As you see, the overlay is not shown.
Differently, when I enter http://tero.local/dr72/?q=node/1#overlay=%3Fq%3Dadmin%252Fconfig%252Fcontent%252Fformats, I get the following.



In this case, the overlay is rendered.