i try to fix very easy problem, but in fact....it is hell !
In CSV file i got the following string :
"Couleur d’étagère"
The apostroph is in msword format, and i want to replace the char by a true apostroph.
So, in my result, following string is displayed :
I use some tricks listed in these questions :
How to replace Microsoft-encoded quotes in PHP
how to replace apostrophe (’) with single quote(')
If i apply this answer :
function convert_smart_quotes($string)
{
$search = array(chr(145),
chr(146),
chr(147),
chr(148),
chr(151));
$replace = array("'",
"'",
'"',
'"',
'-');
return str_replace($search, $replace, $string);
}
It works, the bad apostroph is well replaced, but i obtain very strange result, and i dont know why :'(