Question marks (not symbols) are displayed instead of Cyrillic
- UTF-8 file encoding without BOM
- Utf-8 is specified in .htaccess
- MySQL is fully translated to utf8mb4_general_ci (in the database itself, the Cyrillic is adequately displayed)
- Encoding in <head> is correct
Php itself:
<?php $connect = mysqli_connect("localhost", "", "", ""); mysql_query('SET NAMES "utf8"'); $output = ''; if(isset($_POST["query"])) { $search = mysqli_real_escape_string($connect, $_POST["query"]); $query = " SELECT * FROM post WHERE title LIKE '%".$search."%' "; } else { $query = " SELECT * FROM post ORDER BY test "; } $result = mysqli_query($connect, $query); if(mysqli_num_rows($result) > 0) { $output .= ' <div class="table-responsive"> <table class="table table bordered"> <tr> <th>Customer Name</th> <th>Address</th> <th>City</th> <th>Postal Code</th> <th>Country</th> </tr> '; while($row = mysqli_fetch_array($result)) { $output .= ' <tr> <td>'.$row["title"].'</td> <td>'.$row["test"].'</td> <td>'.$row["City"].'</td> <td>'.$row["PostalCode"].'</td> <td>'.$row["Country"].'</td> </tr> '; } echo $output; } else { echo 'Data Not Found'; } ?> Maybe someone faced with a similar? I suffer all day.