PHP: Problems comparing data from a DB with data from http request
I'm trying to compare data that's coming from a DB with data from one http request.
When I use plain old ascii data, I have no problem comparing both, however, when I try to use the string "Universidad Pedagógica Nacional", I can't tell when there's a match between the two. Just to see what was going on, I tried to compare the rawurlencode of both strings, and then I noticed that both string are not exacly equal. See what both values would be:
See? The first is from the http request, the second came from the DB. Any ideas how I can avoid it?
Thanks in advance.
First you need to decide which lang you are going to use internally (English or Spanish), then ensure that any entered data is re-rendered into that lang/alphabet.
Or ensure all data entry uses the same UTF encoding std. Unfortunately, there is more than one UTF encoding avail...
Thanks for your swift replay, man. I just noticed that I won't have a problem with that, cause the data that will be provided in the http request will be like the data in the DB (just changed the parameter to what the rawurlencode function said it was and then the match happened! Cool! Now I don't have problems with accents:
Look at basically any item from this list:
Every one works... except for the ones that have a ' or " in the name (like McDonald's, or D'Candido)
I guess I'll have to take a closer look at it tomorrow (it's already late at night here so I'm heading to bed... anyway, take a look to see what you can think of).
|All times are GMT -5. The time now is 08:35 AM.|