title: PHP - json_encode(string, JSON_UNESCAPED_UNICODE) not escaping czech chars
body: <p>I'm selecting some data from database and encoding them as json, but I've got a problem with czech signs like </p>
  
  <blockquote>
    <p>á,í,ř,č,ž...</p>
  </blockquote>
  
  <p>My file is in utf-8 encoding, my database is also in utf-8 encoding, I've set header to utf-8 encoding as well. What else should I do please?</p>
  
  <p>My code:</p>
  
  <pre><code>header('Content-Type: text/html; charset=utf-8');
  while($tmprow = mysqli_fetch_array($result)) {
          $row['user'] = mb_convert_encoding($tmprow['user'], "UTF-8", "auto");
          $row['package'] = mb_convert_encoding($tmprow['package'], "UTF-8", "auto");
          $row['url'] = mb_convert_encoding($tmprow['url'], "UTF-8", "auto");
          $row['rating'] = mb_convert_encoding($tmprow['rating'], "UTF-8", "auto");
  
          array_push($response, $row);
      }
  
      $json = json_encode($response, JSON_UNESCAPED_UNICODE);
  
      if(!$json) {
          echo "error";
      }
  </code></pre>
  
  <p>and part of the printed json: <code>"package":"zv???tkanalouce"</code></p>
  
  <p><strong>EDIT:</strong> Without mb_convert_encoding() function the printed string is empty and "error" is printed.</p>