Using php to create a password system with chinese characters

Posted by WillDonohoe on Stack Overflow See other posts from Stack Overflow or by WillDonohoe
Published on 2010-04-14T12:57:45Z Indexed on 2010/04/14 13:03 UTC
Read the original article Hit count: 145

Filed under:
|
|

Hi guys,

I'm having an issue with validating chinese characters against other chinese characters, for example I'm creating a simple password script which gets data from a database, and gets the user input through get.

The issue I'm having is for some reason, even though the characters look exactly the same when you echo them out, my if statement still thinks they are different.

I have tried using the htmlentities() function to encode the characters, the password from the database encodes nicely, giving me a working '& #35441;' (I've put a space in it to stop it from converting to a chinese character!).

The other user input value gives me a load of funny characters. The only thing which I believe must be breaking it, is it encodes in a different way and therefore the php thinks it's 2 completely different strings.

Does anybody have any ideas?
Thanks in advance,
Will

© Stack Overflow or respective owner

Related posts about php

Related posts about utf-8