homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Dealing with accentuated french characters
Characters are replaced by question marks in Firefox

 3:49 pm on Jan 8, 2010 (gmt 0)

I have problems with french characters like à,é,è contained in words extracted from a mysql database. These characters are being replaced by question marks in firefox.

How can I solve that?




 8:16 pm on Jan 8, 2010 (gmt 0)

Convert them into HTML 4.0 entities for Latin-1 (ISO 8859-1) characters [google.com]

For example:

char .. HTML ....... Decimal .... Hex 
.... Á ... Á ... Á
.... À ... À ... À
.... á ... á ... á
.... à ... à ... à


 10:01 am on Jan 11, 2010 (gmt 0)

I read on the Internet that the browser replaces any unknown character by a question mark.
I Think that I need a function that can make the browser convert unknown characters taken from MySQL.

Who can help?

Alternative Future

 1:11 pm on Jan 11, 2010 (gmt 0)

I think you will find that lavazza has answered your question! The only way that I am aware of for completing this is to do the conversion as suggested above.



 10:57 pm on Jan 11, 2010 (gmt 0)

You could **try** changing the charset in the head of your documents, not sure what you are using now but experiment with them. The best choices have already been offered, but this might work for you:

Character encoding, entity references and UTF-8 [webmasterworld.com]


 9:43 am on Jan 12, 2010 (gmt 0)

How do i change the characterset in the head? (please, the code!)


 11:00 am on Jan 12, 2010 (gmt 0)

You can also change the collation of your database:

Me personally, I would go with lavazza`s option.



 5:48 pm on Jan 12, 2010 (gmt 0)

Its really a very difficult question. I read that there was a possibility of setting up a character set after the connection line which i did. i tried a couple of character sets using mysqli_set_charset($connection, 'uft8') and the like but with no success.

What was strange is the fact that the character set used by the browser was the same with the one used by the database but the french characters were still replaced by question marks.

please help


 8:23 pm on Jan 12, 2010 (gmt 0)

There's 3 answers here and changing the characters to the hex or HTML version is probably the best choice... Most of the people who answered have been coding PHP for quite a while and when they say, 'Blah is what I would do', they mean 'Blah, is *exactly* what they *would* do', so I don't understand what help you are looking for rather than taking their advice?

I would personally convert the characters to HTML entities myself...

It's really not a very difficult question or task, and str_replace() should help you take care of it.


 7:21 pm on Jan 13, 2010 (gmt 0)

It looks like your conversion may have just gotten easier:
Special character => Numerical code converter [webmasterworld.com]

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved