Why is Drupal urlencoding in tpl output? In Drupal 7, I have

&lt;?php print $some_content; ?&gt;


in page.tpl.php and when the string $some_content contains a URL (i.e., &lt;a href="some-url?parameters=1|2|3|5"&gt; ... )

the URL gets urlencoded and parameters is shown as:

parameters=1%7C%7C2%7C3%7C5


where | is substituted by %7C. For aesthetic reasons I want Drupal to stop this conversion, but even if I try with urldecode(), it does not work, as it seems to be hard-coded on Drupal core itself.

How can I override this which is just a simple line in pure PHP?
Drupal is not URL encoding in the template output, it doesn't try to make that sort of blind string replace anywhere.

If the URL was prepared using any of Drupal's url() function, which is likely if you're using well written modules, then you should expect the query parameters to be properly encoded.

Drupal tries hard to conform to standards, you're probably going to find it more trouble than it's worth to get it to produce an invalid URL (which your desired result would be); it would be easier to simply write your own invalid version of url() and use that to prepare the content.