Problems with accented characters in French

Problems with accented characters in French

levreaujlevreauj Posts: 1Questions: 0Answers: 0
edited June 2013 in General
First accented characters would simply no show in the browser, corrected that with adding a utf8_encode
FROM: $row[] = $aRow[ $aColumns[$i] ];
TO: $row[] = utf8_encode( $aRow[ $aColumns[$i] ]);
That solve the display problem but there was still a searching problem

Searching with a accented character would not bring back anything, searching with the same character non accented gave back occurence of both the accented and the not accented character

Searching for "e" brought back every instance of "e" AND "é" but searching for "é" brought back nothing

Finally the answer was in telling php that the link to be created with mysql had to be in UTF8

mysql_set_charset ("UTF8", $link_to_database);

Worked beautifully for the searching but weird characters on the display, so took away the utf8_encore and VOILÀ!!!!

So just adding: mysql_set_charset ("UTF8", $link_to_database); worked for me

Have fun! I did!

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Excellent - great to hear you have this working now.

    Might be worth reconfiguring your MySQL / PHP install to do this by default in future?

    Allan
This discussion has been closed.