I'm using a PHP script to get some data from a MySQL database table.
I can see the table has the collation utf8mb4_general_ci
When the text is displayed on the page, I get:
Cust�ias
Instead of:
Custóias
This is what I'm trying:
echo '<span id="address_city">'.iconv('utf8mb4_general_ci', 'UTF-8', $row['address_city']).'</span>', "</br>";
And:
echo '<span id="address_city">'.converter($row['address_city']).'</span>', "</br>";
With:
function converter($conteudo){
return iconv( 'utf8mb4_general_ci', 'UTF-8', $conteudo );
}
And also:
header('Content-Type: text/html; charset=utf-8');