We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10489
    • 93 Posts
    Hi All,

    I’m pulling my hair out here.

    I have a site running on a live server without any problems.
    I zipped all the files and backed up the database using phpmyadmin.

    I then uploaded the zipped file to a new server, unzipped it, created a new database and ran the exported SQL file against the new database.
    Edited the config and the System Setting table...everything at this point work fine.

    However:
    All the content now seems to have very strange characters showing up all over the place.
    Eg....
    1. all hyphens (-) have changed to (—)
    2. (He’s) have changed to (He’s)
    and the list goes on

    Does anyone have any idea what caused this and how to fix it?

    thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The character sets of the two databases don’t match.

      Remove the new one, and create a new database making sure the character set and collation, as well as the connection charset, matches the original.
        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
        • 10489
        • 93 Posts
        Both database are using:
        MySQL charset: UTF-8 Unicode (utf8)
        MySQL connection collation: utf8_general_ci
          • 3749
          • 24,544 Posts
          Is MODx using UTF-8 as well?

          Have you looked in the DB to see if the actual tables and fields are in UTF-8?

          Did you convert the character set and/or collation of the original DB after there was data in it? If so, the data itself is probably still in Latin1.
            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
            • 10489
            • 93 Posts
            Hi BobRay,

            Modx is using: Unicode (UTF-8)-utf-8
            The tables and content are in: latin1_swedish_ci

            I did no conversion, just a simple export of original and import to new database
              • 3749
              • 24,544 Posts
              Quote from: garthswest at Oct 09, 2010, 03:29 AM

              Hi BobRay,

              Modx is using: Unicode (UTF-8)-utf-8
              The tables and content are in: latin1_swedish_ci

              That’s your problem then. MODx is trying to use utf-8 to display Latin1 data.

              Since you have the DB backed up, you could try using the advanced option in setup to use Set Names to Latin1.

              You could also try a new import using PhpMyAdmin and specifying that the character set of the file is Latin1. Dealing with character sets is a black art so I’m not sure what the best option is at this point.



                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
                • 10489
                • 93 Posts
                Hi Bob,

                I downloaded your cdc app, haven’t tried it yet though.

                I edited the modx config file and made this change:
                $database_connection_charset = ’latin1’;

                now everything seems fine. Could i leave it like this or should i rather use:
                UTF-8

                  • 3749
                  • 24,544 Posts
                  I’ve got the CDC script working for Revolution (it should also work with all versions of Evolution but I haven’t tested it).

                  You might want to give that a try to prevent future problems. Be sure to download the newest version:

                  http://bobsguides.com/convert-db-utf8.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