I am working on a site that uses / stores accented characters in a database. I have a page template installed so that the charset config.php variable matches this parameter, for example:
<meta charset="<?php echo $this->config->item('charset');?>">
The problem that I encountered is that if $config['charset']installed in UTF-8 , form validation fails, and as if no character was sent, a character with an accent was added. So, for example, a required field will be returned if it is included in the string. The line minus á works fine.
I managed to get this working by changing $config['charset']to ISO-8859-1 and converting the text to UTF-8 before pasting / after retrieving from the database using php utf8_encode()and utf8_decode(). Is this the best way or am I missing something necessary to get UTF-8 with accented characters working in CodeIgniter?
Any advice is appreciated.
source
share