I have a problem with checking Chinese characters against other Chinese characters, for example, I create a simple password script that receives data from the database and receives user input via get.
The problem I ran into is for some reason, even though the characters look exactly the same when you echo them, the if statement still thinks they are different.
I tried to use the htmlentities () function to encode characters, the password from the database encodes beautifully, giving me a working & # 35441; "(I put a space there to stop it from switching to a Chinese character!).
Another user input value gives me tons of funny characters. The only thing that, in my opinion, should break it, is encoded differently, and so php thinks these are 2 completely different lines.
Does anyone have any ideas?
Thanks in advance,
Will it
Edit:
Thanks for the quick answers guys, I'm going to look at the encoding order of the database in UTF-8, however at the moment the results from the database are not a problem, they encode htmlentities correctly, these are the results that I get from $ _GET, which causes problems.
Cheers
Will it
source share