CodeIgniter Forums
French language and CI. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: French language and CI. (/showthread.php?tid=19820)



French language and CI. - El Forum - 06-19-2009

[eluser]Unknown[/eluser]
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?

Thanks


French language and CI. - El Forum - 06-19-2009

[eluser]moonbeetle[/eluser]
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' />


Advise:
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.


French language and CI. - El Forum - 06-19-2009

[eluser]Unknown[/eluser]
Hi,

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!