Welcome Guest, Not a member yet? Register   Sign In
French language and CI.

Hello everybody,

This is my first post here so be patient Smile

I have a issue with CI. My website is in french. I used the scaffolding function to insert data in a mysql table. This table is using latin1_swedish_ci default encoding.

In the config.php, the charset is set to UTF-8.

$config['charset'] = "UTF-8";

Finally, on the view, for the word été, here what I get : Été.

The viewfile is saved in ANSI-1252.

As you can see, I'm a bit lost in all these encoding methods. Does anyone can help me a bit to solve my problem?


The way I solved similar tedious issues was updating to a recent CI version and setting everything to UTF-8

1). CI's config file
$config['charset'] = "UTF-8";

2). CI's database config file:
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

3). MySQL
- the database collation
- the database table collation
- the database table (VARCHAR) field collation
- setting my editor to save code in UTF-8 format

4). Adding the meta tag to the View pages
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

try first if adding the <meta> tag to your view files solves the problem (make sure you set the charset only once and have it set to utf-8).

If that fails, consider a test with all of the above.


It worked like a charm. My main problem was that I forget to include the META tag. I also did what you said just to be sure that everything is in UTF-8.

Thanks alot!

Theme © iAndrew 2016 - Forum software by © MyBB