Jump to content

Comparing strings with international characters


toni.degroof

Recommended Posts

I have words like marrón, habláis, mañana that are in a mysql database. Users of my website can fill in these words in a form [it is a kind of a test]. In php I compare the 2 strings. The one I get from the database and the one I get from the user via $_POST.

This works fine for 'normal' words, without international characters. First I had the problem that, when getting data from the database, i got some weird signs instead of the int. Characters. I used htmlentities() and that solved the problem. Now the input from the user and the result from the database look exactly the same, but when i compare them, php tells me the answer is wrong, and shows the correct answer, witch is exactly as what the user typed. a letter ó from the selectbox is not the same ó from the database, although they look the same on the screen. How can I solve this problem ?

www.images2study.com [not finished yet]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.