I am experiencing some problem on UTF-8 Encoding. I have a CSV file and this is the content of it:
Quién tú - Tes, más , S03
Who you, More, SO2
I have extracted it one by one and I have this condition in my loop
if(mb_detect_encoding($exploded_value[$i], 'UTF-8', true))
{
echo $cleaned_data = utf8_encode($exploded_value[$i]);
}
else
{
echo $cleaned_data=$exploded_value[$i];
}
My cleaned data became like this:
Quién tú - Tes
más
S03
Who you
More
SO2
Character's like á, ç, ú gets decoded and when retrieved it gives the wrong output.
Text with Spanish character are being detected as UTF-8 encode character. So, it falls into utf8_encode($exploded_value[$i]). And when utf8_encode perform its process it got decoded.
Declaration of my meta content type is charset=UTF8
Anyone have encountered this issue. Can you share on how did you fix it? Please help. I have googled around and didn't find any luck.