title: How to avoid malformed URI sequence error?
body: <p>I'm working with perl. I have data saved on database as  <code>Â â€œ</code></p>
  
  <p>and I want to escape those characters to avoid having malformed URI sequence error on the client side. This error seems to happen on fire fox only. The fix I found while googling is not to use <code>decodeURI</code> , yet I need this for other characters to be displayed correctly.</p>
  
  <p>Any help? <code>uri_escape</code> does not seem enough on the server side.</p>
  
  <p>Thanks in advance.</p>
  
  <hr>
  
  <p>Detalils:
  In perl I'm doing the following:</p>
  
  <pre><code>print "&lt;div style='display:none;' id='summary_".$note_count."_note'&gt;".uri_escape($summary)."&lt;/div&gt;"; 
  </code></pre>
  
  <p>and on the java script side I want to read from this div and place it on another place as this:</p>
  
  <pre><code>getObj('summary_div').innerHTML= unescape(decodeURI(note_obj.innerHTML));
  </code></pre>
  
  <p>where the note_obj is the hidden div that saved the summary on perl.
  When I remove decodeURI the problem is solved, I don't get malformed URI sequence error on java script. Yet I need to use decodeURI for other characters. </p>
  
  <p>This issue seems to be reproduced on firefox and IE7.</p>