title: UTF-8 and ISO-8859-15 in Oracle Database
body: <p>I have:</p>
  
  <p>1) Oracle database 1, where </p>
  
  <pre><code>SELECT * FROM v$nls_parameters WHERE parameter LIKE '%CHARACTERSET'
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>NLS_CHARACTERSET                                                 
  WE8ISO8859P15                                                             
  
  NLS_NCHAR_CHARACTERSET                                           
  AL16UTF16    
  </code></pre>
  
  <p>2) Oracle database 2, where</p>
  
  <pre><code>NLS_CHARACTERSET                                                 
  AL32UTF8                                                        
  
  NLS_NCHAR_CHARACTERSET                                           
  AL16UTF16       
  </code></pre>
  
  <p>3) H2 database 3   </p>
  
  <p>So, I have copied some CLOBs from DB1 to DB2 using sqlloader. Then I've copied them to DB3 from DB2 using PreparedStatement. </p>
  
  <p>And then i read them like </p>
  
  <pre><code>private String parseCLOB(Object t) {
      if (t instanceof oracle.sql.CLOB|| t instanceof org.h2.jdbc.JdbcClob) {
          InputStream i = t.getAsciiStream();
          StringWriter w = new StringWriter();
          IOUtils.copy(i, w, "UTF-8");
          t = w.toString();
      }
      return t
  } 
  </code></pre>
  
  <p>It has broken symbols for DB2, works fine for DB3. But if I substitute "ISO-8859-15", it works fine for DB2 and breaks for DB3. </p>
  
  <p>What should I do to have both databases working? </p>