i have some problem encoding. I m making a plugin and in my table i have insert some words with the "é' but the result of display is �.
My tables are utf8_general_ci, in wp config the encoding is utf8. I tried also to comment define('DB_CHARSET', 'utf8mb4'); define( 'DB_COLLATE', '' );
But nothing is working. How can i do?
This is the request
global $wpdb;
$resu = $wpdb->get_results('
SELECT '.$wpdb->prefix.'mic_combinaisons.id, '.$wpdb->prefix.'mic_keyword.keyword, '.$wpdb->prefix.'mic_secteurs.libelle
FROM '.$wpdb->prefix.'mic_combinaisons
INNER JOIN '.$wpdb->prefix.'mic_keyword ON '.$wpdb->prefix.'mic_keyword.id = '.$wpdb->prefix.'mic_combinaisons.id_keyword
INNER JOIN '.$wpdb->prefix.'mic_secteurs ON '.$wpdb->prefix.'mic_secteurs.id_secteurs = '.$wpdb->prefix.'mic_combinaisons.id_secteur', OBJECT
);
and i try to display like
foreach ( $resu as $res ) {
$id = $res->id;
$keyword = strtolower(str_replace(" ","-",$res->keyword));
$secteur = strtolower(str_replace(" ","-",$res->libelle));
$mic_slug = normalize($keyword) ."-".normalize($secteur)."-k".$id;
echo($mic_slug);