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]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.