title: Problems with german umlauts in PHP
body: <p>I am trying to get some data from my MySQL server, but german umlauts are converted to its unicode-specific code.</p>
  
  <pre class="lang-php prettyprint-override"><code>header("Content-type: application/json; charset=utf-8"); 
  $mysqli = new mysqli('host', 'user', 'pwd', 'databasename');
  $mysqli-&gt;set_charset("utf8");
  
  $result = $mysqli-&gt;query("SELECT Name FROM Table");
  SQLtoJSON($result);
  
  
  function SQLtoJSON($ab) {
      $tempArray = array();
      $myArray = array();
      while($row = $ab-&gt;fetch_object()) {
          $tempArray = $row;
          array_push($myArray, $tempArray);
      }
      echo json_encode($myArray);
  }
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>[{"Name":"Frische-B\u00e4ckerei-Huber"}]
  </code></pre>
  
  <p>It should be:</p>
  
  <pre><code>[{"Name":"Frische-Bäckerei-Huber"}]
  </code></pre>
  
  <p>I also tried <code>$mysqli-&gt;query("SET NAMES 'UTF8'")</code>, but it didn't work. The server's charset is UTF-8.</p>
  
  <p><strong>EDIT:</strong> It's definitely a problem with json, <em>var_dump()</em> has the correct text.</p>