Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

problem with french accented characters

Accented characters replaced by question marks



2:50 pm on Jun 7, 2011 (gmt 0)

5+ Year Member

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?

Thank you in advance.


4:02 pm on Jun 7, 2011 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Discussion in progress [webmasterworld.com]. - it's the same issue, really.


5:33 pm on Jun 7, 2011 (gmt 0)

5+ Year Member

Yes, it seems that the discussion you suggest teaches replacing ISO-8859-1 (latin1) with UTF-8. When i do the accented characters are replaced by black diamonds and my problem is not solved out.


6:04 pm on Jun 7, 2011 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

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.


3:32 pm on Jun 8, 2011 (gmt 0)

5+ Year Member

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.


Featured Threads

Hot Threads This Week

Hot Threads This Month