Hi, I am getting data from a mysql database which has latin1 as charset and latin1_general_ci as collation. I use htmlentities() function to change the french accented characters into normal ones but the browser is replacing all the accented characters like "à", "é", "è" with question marks. Has someone encountered this problem before? How can I solve it?
It's not solved, but you've got more information. Latin-1 question marks vs. Unicode diamonds.
I use htmlentities() function
Is this done when the characters enter the database or when they leave it? What is the file encoding of the page itself? As noted in the other thread, changing the meta tag by itself doesn't change the underlying text, it just changes how the browser interprets it.
At some point between the database and the final page display, your non-ASCII characters are being, er, de-entitized. Have you looked at the page code? Not the preliminary php/whatever, but the source code of the actual page as displayed in a browser. If you're not seeing entities, something has gone wrong.
i tried to see the page code and indeed the page code does not contain entities, the problème occurs when the data leaves the database from a linux (old red hat system) host. There's no problem with the same PHP program and database on my local windows machine. Actually, even on the linux machine there was not problem until yesterday. Probably someone changed something. The htmlenties() function does not solve the problem.