I am trying to read a .csv file and use its data after, but when I use the text that I am getting from this file it is coming with some "question marks in black diamonts" where it is suppose to have some special chars, like "á", "ú".
I thought that maybe the text from the .csv file was in a different encoding, but I did a mb_detect_encoding and it showed that it was UTF-8
This is the code I am using now:
<html>
<head>
    <meta charset="utf-8">
</head>
<body>
<?php
$row = 1;
$handle = fopen ("Exportar.csv","r");
$url = array();
$text1 = array();
$text2 = array();
$title = array();
$subtitle = array();
$description = array();
$image = array();
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $num = count ($data);
    if ($row > 1) {
        $url[$row -2 ] = $data[2];
        echo $text1[$row -2] = $data[6];
        //echo $encode = mb_detect_encoding($text1[$row -2]);
        $text2[$row -2] = $data[7];
        $title[$row -2] = $data[8];
        $subtitle[$row -2] = $data[9];
        $description[$row -2] = $data[10];
        $image[$row -2] = $data[11];
    }
    $row++;
}
fclose ($handle);
// Rest of the code....
?>
And this is the output:
Vimos que voc� n�o realizou nenhum pedido em nosso site nos �ltimos 90 dias. Para o seu pr�ximo pedido, ganhe 15% de desconto em todo o site!
 
    