title: Convert hex to string when read from registry
body: <p>I'm working with Delphi 7 application and BDE (legacy software).
  whenever the password is changed/saved from ODBC admin
  like this (example if the password was  <code>my,password</code> )</p>
  
  <p><img src="https://i.stack.imgur.com/vDnRa.jpg" alt="enter image description here"></p>
  
  <p>It gets saved as <code>my%2cpassword</code> in the registry.</p>
  
  <p><img src="https://i.stack.imgur.com/5VtC6.jpg" alt="enter image description here"></p>
  
  <p>And my application reads the registry path </p>
  
  <blockquote>
    <p>HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\mysource<br>
     Password</p>
  </blockquote>
  
  <p>then uses the password to execute a psql command,</p>
  
  <pre><code>   "C:\Program Files (x86)\PostgreSQL\9.0\bin\psql.exe"  -h localhost -p 5432 -d myDB -U myadmin -f "C:\Users\user\AppData\Roaming\ff.sql"
  </code></pre>
  
  <p>Since the password now has <code>%2c</code> inside it instead of <code>,</code> the authentication fails.
  As I read the password and write to the <code>pgpass.conf</code> file.</p>
  
  <p>How to convert the Hex characters to proper string when the HEX character are mixed with normal character?</p>