title: PHP json_encode umlauts
body: <p>I'm getting json strings from an HTTP API. The content type is Content-Type: application/json; charset=UTF-8.</p>
  <p>I then proceed to write the strings to a file using.</p>
  <pre><code>fwrite($fp, json_encode($post));
  </code></pre>
  <p>The strings contain encodings for umlauts as follows.</p>
  <blockquote>
  <p>Au\u00dfenministerium verh\u00e4ngte Reisewarnung f\u00fcr Kroatien in
  Kraft getreten.</p>
  </blockquote>
  <p>This should be.</p>
  <blockquote>
  <p>Außenministerium verhängte Reisewarnung für Kroatien in Kraft
  getreten.</p>
  </blockquote>
  <p><strong>How can I encode the strings to write umlauts to files and not their encoding?</strong></p>
  <p>I tried the following.</p>
  <pre><code>&lt;?php
  $string = &quot;Au\u00dfenministerium verh\u00e4ngte Reisewarnung f\u00fcr Kroatien in Kraft getreten.&quot;;
  $string = utf8_encode($string);
  echo $string;
  </code></pre>
  <p>The output of this script still shows the encoding.</p>