Installation & Configuration

How do I configure Nucleus to use non-English languages (e.g. Asian languages)?

Scenario:
"I blog in a non-English language and am having encoding issues. When I post a blog item, the non-English characters often get saved as their HTML entities or as strange symbols. What can I do to fix this?"

Original forum thread (thanks, MarioD_kr):
http://forum.nucleuscms.org/viewtopic.php?t=12345

Solution:
You need to change the variable _CHARSET in english.php (located in the language directory under the nucleus root) to UTF-8 vice iso-8859-1. You may also need to convert all of your database tables to UTF-8.

  1. Navigate to the /nucleus/language/ directory inside your Nucleus installation and open the english.php file.
  2. Look for the following lines of code:
    // charset to use
    define('_CHARSET',					'iso-8859-1');

    and change them to this:

    // charset to use
    define('_CHARSET',               'UTF-8');
  3. Restart your server/refresh your Nucleus site. Make a couple of posts and see if you are still having the same problems.
  4. If you are still having problems, edit the skin you are using via the Nucleus admin area. Most skins will be using some sort of include file, e.g. head.inc. Open that file and paste the following line in there after the <head> tag near all the other <meta> tags:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

If it is still not working, then you will need to convert your MySQL database to UTF-8.

  1. Open phpMyAdmin and click on "Show MySQL system variables". Or open a MySQL command prompt and type "\s" (without quotes).
  2. Check to see if the variables "Character set server" and "Character set database" (may also show up as "Server characterset" and "Db characterset") are equal to "utf8".
  3. If not, change the server characterset through your admin interface (contact your host or refer to your admin interface's help file). To change the database characterset, open an SQL query window or the MySQL command prompt and type the following:
    ALTER DATABASE db_name CHARACTER SET utf8;

    where db_name is the name of your database.
  4. You may still need to manually convert all your tables to UTF-8 using the following command:
    ALTER TABLE nucleus_item CONVERT TO CHARACTER SET utf8;

    for every single table in your database.
section: Installation & Configuration | submitted by Leng on 2006.Aug.06 | 7503 views

item rate
Total votes: 20 - Rating: 3.35

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10