title: Bytes count in UTF-16 strings
body: <p>Why does UTF-16 string of 2 characters take only 6 bytes in memory, while UTF-16 string of 1 character takes 4 bytes?</p>
  
  <p>Here's a SSCCE in java to demonstrate this behavior:</p>
  
  <pre><code>public class UTF16Test{
      public static void main(String[] args) throws Exception {
          System.out.println("A".getBytes("UTF-16").length);
          System.out.println("AB".getBytes("UTF-16").length);
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>4
  6
  </code></pre>