title: Understanding character encoding in typical Java web app
body: <p>Some pseudocode:</p>
  
  <pre><code>String a = "A bunch of text"; //UTF-16
  saveTextInDb(a); //Write to Oracle VARCHAR(15) column
  String b = readTextFromDb(); //UTF-16
  out.write(b); //Write to http response
  </code></pre>
  
  <p>When you save the Java <code>String</code> (UTF-16) to Oracle VARCHAR(15) does Oracle also store this as UTF-16?  Does the length of an Oracle VARCHAR refer to number of Unicode characters (and not number of bytes)?</p>
  
  <p>When we write <code>b</code> to the <code>ServletResponse</code> is this being written as UTF-16 or are we by default converting to another encoding like UTF-8?</p>