CakePHP character encoding / special characters

In a few shorts steps:
SOURCE CODE
Start with your source code. Are your files saved as UTF-8? If not, they should be. This will enable you to use “special characters” in your code (flash messages, etc..)
DATABASE TABLES
Make sure all your tables and fields have encoding set to utf8.
DATABASE CONNECTION(S)
CakePHP has a very nice option for setting the database encoding automagically, just use the following line in your database config:

APPLICATION CONFIG
Make sure your application is indeed serving pages as UTF-8. In your ~/app/config/core.php use this:

Also check you have this in your layout (in thesection):

 

 

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *