Jan-Thore Skjelfjord Tue Jul 30 13:25:28 -0400 2013

Subject: PHP ActiveRecord utf-8

I've run into a small problem here, and I'm unable to solve it!
It seems PHP ActiveRecord is unable to find the user when the username contains e.g. Ð or ï or something similar.
And this is most likely a char-set issue, everything works as it should if the name contains "normal" characters (e.g. NOT Ð or ï)

I've tried both the following...
$data['user'] = user_model::find(array('conditions'=>array('name = ? AND password = ?', $name, $password)));
$data['user'] = user_model::find_by_name($name);

None of these work.
I've also checked out several threads on this forum, one of them being http://www.phpactiverecord.org/boards/4/topics/120

I'm currently using WAMP 2.2
Apache: 2.2.21
MySQL: 5.3.13
PHP: 5.5.16

My DB table is set to "utf8_unicode_ci" and so is my CodeIgniter's db config.

Any help would be greatly appreciated.

Edit: It seems even CI's own ActiveRecord can't find anything when using Ð or ï :S


Jan-Thore Skjelfjord Tue Jul 30 15:22:14 -0400 2013

Managed to solve the problem!
the character "Ð" was encoded, so when i checked with the database it used "%C3%90" instead of "Ð".
Which means i have to decode that single URi segment.

(1-1/1)