title: Json converts & in a String to \u0026
body: <p>I am trying to extract text from pdf and write it into a json file. While extracting unicode characters the Json converts all &amp; to \u0026. For example my actual String is <code>&amp;#1588</code>. (which represents &#1588;). It prints correctly to a .txt file, to console etc. But when I try to print this string to a Json file it shows <code>\u0026#1588;</code>. </p>
  
  <p>I am using Java, and the code is</p>
  
  <pre><code>Gson gson = new Gson();
  String json = gson.toJson(pdfDoc);
  </code></pre>
  
  <p>Note: <code>pdfDoc</code> is an object, that contains all the details (position, color, font.. etc) of characters inside the input PDF document.  I am using <code>gson-2.2.1.jar</code>.</p>