Hi, i use the UTF-8 charset in the whole application (database, views, controllers, etc), but for a strange reason, when i render the data from the controller to the view, it seems that the charset is missing or something, and some strange characters appears when there must be ñ's, tildes, etc.... The data are ok from model to controller. But not from controller to view. must i set any parameter in the framework or something?
thanks!! Delia
CommentAuthordelia
i've found the problem. in the ApplicationController i'd set the function __construct to force de UTF-8 for the database, and in the controller i'd forgotten to call parent::__construct();
thanks!
CommentAuthorenser
Hi delia. Can you write some more details about the __construct method.
I have similar problem. In order to display correctly the text i must change the encoding on the browser, for example in my case in Cyrillic (windows-1251).
If you have maybe any other suggestion please write.
Thanks!
CommentAuthordelia
hi ender,
Finally i read in some place (i cant remember now), the way to solve the problem. Just put this code at the end of the config/boot.php file:
if (!defined('AK_SET_NAMES')) { require_once(AK_LIB_DIR.DS.'AkActiveRecord.php'); global $dsn; $dao =& Ak::db(&$dsn); $dao->Execute('set names utf8'); unset($dao); define('AK_SET_NAMES', true); }