Welcome to WebmasterWorld Guest from 54.144.124.152

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Dealing with accentuated french characters

Characters are replaced by question marks in Firefox

     

dbarasuk

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

5+ Year Member



Hello,
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?

Thanks

lavazza

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

5+ Year Member



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

For example:

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

dbarasuk

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

5+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



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.

-gs

rocknbil

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

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



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]

dbarasuk

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

5+ Year Member



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

dreamcatcher

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

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



You can also change the collation of your database:
[dev.mysql.com...]

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

dc

dbarasuk

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

5+ Year Member



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

TheMadScientist

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

WebmasterWorld Senior Member themadscientist is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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.

TheMadScientist

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

WebmasterWorld Senior Member themadscientist is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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

Featured Threads

Hot Threads This Week

Hot Threads This Month