title: Get non-ASCII character from single character code
body: <p>I have a couple databases where the NLS character encoding differs. One uses <code>AL32UTF8</code> (UTF-8), and the other uses <code>WE8MSWIN1252</code> (Windows 1252). Yes, this is bad, and I will push for getting things straightened out so they're the same. In the meantime, I need to write some SQL containing a non-ASCII character. For example, I need to use á, which is <code>U+00E1</code> in Unicode. In UTF-8, it's represented with the hexadecimal value <code>0xC3A1</code>, and in Windows 1252 it's represented with the hexadecimal value <code>0x00E1</code>. (In other words, those are the byte values.)</p>
  
  <p>So this gives me what I want on the UTF-8 database:</p>
  
  <pre><code>SELECT CHR(TO_NUMBER('C3A1', 'xxxx')) FROM DUAL;
  </code></pre>
  
  <p>And this gives me what I want on the Windows 1252 database:</p>
  
  <pre><code>SELECT CHR(TO_NUMBER('00E1', 'xxxx')) FROM DUAL;
  </code></pre>
  
  <p>I can't seem to figure out a way to get Oracle to just take one and convert it to the right encoding, though. I don't really care which representation I end up using. I just want to only use one hexadecimal value since the same script needs to run on both databases. How can I do that?</p>
  
  <p>Using Oracle 11g. (Unfortunately, one is 11.1 and the other is 11.2 for the moment.)</p>