As I couldn't get replacement functions to work, I made my own piece of script to replace specific letters in a string.
I wanted to test it only with the letter "é", so here it is:
$query = "SELECT name_fr
FROM i_countries";
$result = mysql_query($query) or die (mysql_error());
while (list($cname) = mysql_fetch_row($result)) {
// $cname = "ééé";
var_dump($cname);
echo $cname.' - ';
$i = 0;
while ($cname[$i]) {
if ($cname[$i] == "é") {
$cname[$i] = 'e';
}
$i++;
}
echo $cname;
echo '<br>';
}
If I execute this script, I'll get something like this:
string(9) "Argentine" Argentine - Argentine
string(6) "Brésil" Brésil - Brésil
...
Note that the "é" in Brésil did not get changed to an "e"...
If I uncomment the commented line, I'll get:
string(3) ",t," ,t, - eee
string(3) ",t," ,t, - eee
...
So my function works, as it changes all "é" to "e".
The only thing is that it displays a "," instead of a "é" in the browser: in HTML a "é" is written é
But why, oh why doesn't it work when the string comes from the database ???
The question should rather be:
How is the "é" different when I assign from the database, and when I assign manually ??? In one case it displays well in HTML, and in the other case it doesn't: this is the proof that they are not seen the same way !