We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1182
    • 1 Posts
    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.

      • 1778
      • 659 Posts
      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
        • 28042 ☆ 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.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 22303 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.
            • 20413
            • 2,877 Posts
            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... tongue
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: mrhaw at Aug 30, 2009, 01:52 PM

              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... tongue
              This is just one reason why it is essential that you start with a database container with the correct Collation.
                • 38142
                • 91 Posts
                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).
                  • 3749
                  • 24,544 Posts
                  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
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting