title: json_encode error for russian characters
body: <p>I am having trouble with the output of json_encode. I need to output Russian characters. </p>
  
  <p>In my database table only Russian characters. In the output I am getting only <code>"????????"</code> question marks replaced Russian characters. I read many similar questions but none of them offered a real solution. I tried the following but none of them helped. </p>
  
  <p>Below is my php code.</p>
  
  <ol>
  <li>added ``header ('Content-type: application/json; charset=utf-8');`</li>
  <li>used <code>json_encode($albums, JSON_UNESCAPED_UNICODE);</code></li>
  <li>tried <code>mb_convert_encoding($str, 'UTF-8', 'auto');</code>
  json_encode($albums, JSON_UNESCAPED_UNICODE);</li>
  </ol>
  
  
  
  <pre><code>&lt;?php
      $host ="localhost";
      $user ="misollar_user";
      $pass="12345";
      $db="misollar_db";
      header ('Content-type: application/json; charset=utf-8');
      $con = mysqli_connect($host,$user,$pass,$db);
      $query = "select * from albums;";
      $result = mysqli_query($con, $query);
      $albums = array();
      while ($row = mysqli_fetch_array($result)){
          array_push($albums,array('id'=&gt;$row[0], 'name'=&gt;$row[1], 'songs_count'=&gt;$row[2]));
      }
      mysqli_close($con);
      echo json_encode($albums, JSON_UNESCAPED_UNICODE);
  ?&gt;
  </code></pre>