title: Converting utf8 to gb2312 in java
body: <p>Just look at the code bellow</p>
  
  <pre><code>try {
          String str = "上海上海";
          String gb2312 = new String(str.getBytes("utf-8"), "gb2312");
          String utf8 = new String(gb2312.getBytes("gb2312"), "utf-8");
          System.out.println(str.equals(utf8));
      } catch (UnsupportedEncodingException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>print false!!!</p>
  
  <p>I run this code both under jdk7 and jdk8 and my code style of IDE is utf8.</p>
  
  <p>Can anyone help me?</p>