title: Java Strings Character Encoding - For French - Dutch Locales
body: <p>I have the following piece of code</p>
  
  <pre><code>public static void main(String[] args) throws UnsupportedEncodingException {
          System.out.println(Charset.defaultCharset().toString());
  
          String accentedE = "é";
  
          String utf8 = new String(accentedE.getBytes("utf-8"), Charset.forName("UTF-8"));
          System.out.println(utf8);
          utf8 = new String(accentedE.getBytes(), Charset.forName("UTF-8"));
          System.out.println(utf8);
          utf8 = new String(accentedE.getBytes("utf-8"));
          System.out.println(utf8);
          utf8 = new String(accentedE.getBytes());
          System.out.println(utf8);
  }
  </code></pre>
  
  <p>The output of the above is as follows</p>
  
  <pre><code>windows-1252
  é
  ?
  Ã©
  é
  </code></pre>
  
  <p>Can someone help me understand what does this do ? Why this output ?</p>