title: Can someone clarify Gson's unicode encoding?
body: <p>In the following minimalistic example:</p>
  
  <pre><code>import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  
  public class GsonStuff {
  
      public static void main(String[] args) {
          GsonBuilder builder = new GsonBuilder();
          Gson gson = builder.create();
          System.out.println(gson.toJson("Apostrophe: '"));
          //Outputs: "Apostrophe: \u0027"
      }   
  }
  </code></pre>
  
  <p>The apostrophe gets replaced by it's unicode representation in the printout. However, the String returned from the <code>toJson</code> method literally has the characters '\', 'u', '0', '0', '2', '7'.</p>
  
  <p>Decoding it with json actually works and gives the string "Apostrophe: '" as opposed to "Apostrophe: \u0027". How should I decode it to get the same result?</p>
  
  <p>And an additional question, why doesn't a random unicode character such as ش get encoded similarly?</p>