Thanks Earnie, but that is not what I am looking for. It is essentially similar to urlencode or rawurlencode. I am looking for a function that does the work like the one present at the bottom of the page here:<br><br><a href="http://www.blooberry.com/indexdot/html/topics/urlencoding.htm">http://www.blooberry.com/indexdot/html/topics/urlencoding.htm</a><br>

<br>For eg:<br><br><a href="http://example.com/q=12">http://example.com/q=12</a> &amp;12grt key=value;&lt;&gt;+,.()!*<br><br>is converted to <br><br><a href="http://example.com/q=12%20&amp;12grt%20key=value;%3C%3E+,.()!*">http://example.com/q=12%20&amp;12grt%20key=value;%3C%3E+,.()!*</a><br>

<br><br clear="all">--<br>Regards,<br>Nitin Kumar Gupta<br><a href="http://publicmind.in/blog/">http://publicmind.in/blog/</a><br>
<br><br><div class="gmail_quote">On Thu, Mar 11, 2010 at 7:32 PM, Earnie Boyd <span dir="ltr">&lt;<a href="mailto:earnie@users.sourceforge.net">earnie@users.sourceforge.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

nitin gupta wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 Hi,<br>
<br><div class="im">
 I am not creating the URL, but I parse the URL from XML content and I<br>
 want to urlencode it. Also, I am looking to preserve all the reserved<br>
 characters in the URL and not just &#39;?&#39; or &#39;&amp;&#39;.<br>
<br>
</div></blockquote>
<br>
<a href="http://www.google.com/search?q=url+encoding+site%3Aapi.drupal.org" target="_blank">http://www.google.com/search?q=url+encoding+site%3Aapi.drupal.org</a> leads you to two api functions url [1] and drupal_urlencode [2].  Are these what you need?<br>


<br>
[1] <a href="http://api.drupal.org/api/function/url" target="_blank">http://api.drupal.org/api/function/url</a><br>
[2] <a href="http://api.drupal.org/api/function/drupal_urlencode" target="_blank">http://api.drupal.org/api/function/drupal_urlencode</a><br><font color="#888888">
<br>
--<br>
Earnie<br>
-- <a href="http://www.give-me-an-offer.com" target="_blank">http://www.give-me-an-offer.com</a><br>
<br>
</font></blockquote></div><br>