This might be a stupid question, but nothing seems to be working for me:
I'm having to compare values between 2 columns on 2 different databases (which I don't have access to change the values). The encoding in db1 is UTF-8. The encoding in db2 is latin1.
So, for example, these are the 2 values I'm comparing and should be the same in the comparison:
**db1_value** = 'Maranhão'
**db2_value** = 'Maranhão';
They display exactly the same way using utf_encode, displaying is not the issue. I'd like to compare the variable db1_value to the field db2_value in the db, so I'm using something very simple like this:
$query = "SELECT **db2_value** FROM db2 WHERE db2_field LIKE '" . **$db1_value** . "'";
How do I convert 'Maranhão'
into '**Maranhão**'
before comparing?
I've tried several methods, iconv, utf8_encode, and a few others, but they make no difference to the variable. I'm just wondering if I'm taking the right approach to do this.
Appreciate any constructive comments on this.
Thanks a lot,