URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "</"
<p>I am getting this exception while trying to generate a .PDF file from my application.</p>

<pre><code>URLDecoder: Illegal hex characters in escape (%) pattern - For input string:....
</code></pre>

<p>Here is the stack trace</p>

<pre><code>java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "&lt;/"
    at java.net.URLDecoder.decode(Unknown Source)
</code></pre>

<p>Here is the code</p>

<p><strong>StringBuffer outBuffer = new StringBuffer();</strong></p>

<p>//some values are added to outBuffer .</p>

<p><strong>String pdfXmlView = URLDecoder.decode(outBuffer.toString(), "utf-8");</strong></p>

<p>While trying to decode using <strong>URLDecoder.decode()</strong> it is throwing that exception. I got the cause for the exception, It is coming because of % character in outBuffer.</p>

<p>If anyone knows how to solve this problem, please help me.</p>

<p>Thanks.</p>
