title: How to encode to ascii chart (ó to %F3)
body: <p>My application needs to redirect my user to a external help page, passing the client name as parameter, but this external help page uses a different encoding.</p>
  
  <p>My original string is</p>
  
  <pre><code>"Diagnósticos da América"
  </code></pre>
  
  <p>and the page expects a String like</p>
  
  <pre><code>"Diagn%F3sticos%20da%20Am%E9rica"
  </code></pre>
  
  <p>I need:</p>
  
  <pre><code>"Diagnósticos da América" =&gt; "Diagn%F3sticos%20da%20Am%E9rica"
  </code></pre>
  
  <p>I'm trying in irb:</p>
  
  <pre><code>"Diagnósticos da América".encode("ISO-8859-1") =&gt; "Diagn\xF3sticos da Am\xE9rica"
  "Diagnósticos da América".encode("UTF-8", "Windows-1252") =&gt; "DiagnÃ³sticos da AmÃ©rica"
  "Diagnósticos da América".encode("Windows-1252") =&gt; "Diagn\xF3sticos da Am\xE9rica"
  </code></pre>
  
  <p>Does someone have an idea?</p>