i tried installing my modx over and over again and i make sure during install collation is set to "utf8_unicode_ci" with "set name". I also tried other collations, but the collation in database always end up in the same coolation.The tables in database are always installed in latin1_swedish_ci, no matter what collation i set during install.
my phpmyadmin is setted :
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf_unicode_ci.
I need my site in chinese, but with latin1_swedish_ci. the characters wont show correctly.
i tried this hack... delete the feild "content" in "modx_site_content", and create a new feild and set it in utf8_unicode_ci, and the character display is fine. But i know this is not the way to do it.
thanks for any help.
I had this one too...
My workaround : First I create the database manually in phpMyAdmin, just giving it a name and the collation I want.
Then I install Modx, on install I give the name of the database I just created... Modx find it and it works fine the collation is the good one...
Maybe this helps...
Cheers
-
☆ A M B ☆
- 24,524 Posts
If MySQL is in its default configuration it will use that collation for creating new tables, unless the database is specifically created with another collation.
-
MODX Staff
- 10,725 Posts
BTW, if you let MODx create the database, it will create the database with the collation you specify. But if you create the database first through some kind of hosting control panel (like CPanel or Plesk) it generally will not allow you to specify this. In that case, before you install MODx you need to go to phpMyAdmin, select your database if necessary, and find the Operations tab. There will appear a section for Collation where you can change this for the entire database container. Now when you run the installation, your tables will be created with the proper Collation.
I manually changed one of my MODx databases to UTF-8 from latin1_swedish_1
First by exporting a sql with DROP TABLE statements and edit replace the collation in the statements
and then import it. But it wasn’t enough. It fixed the tables but not the rows
so I had to manually go through every row. Not worth it...
Just a footnote for people using CPanel and PHPMyAdmin: In PHPMyAdmin there is a general setting for the collation to be used. You can set this to UTF8 before using the CPanel database creation wizard to create the database, BUT this is likely to be ignored when you actually create the database (at least that happened to me). After you create the database but BEFORE installing MODX you have to go back into PHPMyAdmin, click the database, click "Operations", then correct the collation.
Like Mr Haw said, it is too painful to try to change the collation after installing MODX because there are three levels of collation (it seems): for the table as a whole, for columns, and for fields, and finding a way to change all of them is hard (too hard for me).
It's worse than that. Just changing the values in the tables can leave you with Latin1 data being read as UTF-8.
See this for a relatively safe (but tedious) conversion process:
http://bobsguides.com/convert-db-utf8.html.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html