We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20879
    • 13 Posts
    PHP Version 4.4.9 and Mysql 5.0

    So, I decided to create a topic about this.

    I installed and reinstalled modx almost 10 times now! On different environments (windows and linux) and the end result is the same: the encoding (collation) in the mysql database is always set to: "latin1_german2_ci" even though i select "utf8_general_ci" during the installation!

    this of course causes problems when i import arabic html pages. Instead of the arabic text, I get a bunch of question marks huh????.

    Is there any plugin or anything that i must install to fix this issue? Am I making a stupid mistake without knowing?

    Any help is appreciated!

      • 20879
      • 13 Posts
      Ok, something is really really wrong...

      i just downloaded a php script that changes the collation of all tables in a database to what the user specifies. I managed to change the collation of all tables to: "utf8_general_ci" but i still get the flippin question marks when I import pages in persian and arabic!!!!

      This is not making any sense.....

      any help is appreciated!
        • 20879
        • 13 Posts
        opps, i forgot to mention:

        I have: PHP Version 4.4.9 and Mysql 5.0

          • 22303 MODX Staff
          • 10,725 Posts
          I believe Persian and Arabic require utf8_unicode_ci, if I’m not mistaken.
            • 20879
            • 13 Posts
            I tried that as well, and I still get question marks!

              • 20879
              • 13 Posts
              ok, well, i resolved the problem.

              I created the database myself and manually set the collation to utf8_general_ci. then asked modx to use the existing database, with that collation that i manually set, and that worked!

              So, the problem really is with the installer: If you allow it to create the database, even though you specificy utf8_general_ci, it will set the collation to something completely different.

              btw opengeek, utf8_general_ci is fine for arabic/persian.

              Thanks,
                • 22303 MODX Staff
                • 10,725 Posts
                Quote from: nahawand at Sep 28, 2009, 01:37 PM

                So, the problem really is with the installer: If you allow it to create the database, even though you specificy utf8_general_ci, it will set the collation to something completely different.
                Actually, no, if you allow the installer to create the database container itself, it will create it with the collation you specify. If you create the database before running the installer, then you are stuck with the collation you created it with and all the tables will be created with the database container’s collation.
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Possibly your database users does not have permissions to change collations, but can create databases?
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: rthrash at Sep 29, 2009, 07:37 AM

                    Possibly your database users does not have permissions to change collations, but can create databases?
                    There is no such permission in MySQL; if you can create a database you can create it with a specific collation supported by your installation.
                      • 20879
                      • 13 Posts
                      So, to put this issue to rest, the culprit was: Mysql!

                      When I login to my admin control panel and create a database, it defaults to latin1_german2_ci. The problem is not with modx obviously.

                      I am not really sure why 1and1 decided to have the mysql installation default to latin1_german2_ci? Anyways, the issue is easily resolved by simply changing the collation to the desired one (general utf8) then linking modx to the database.