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

    I’ve search around for a resolution and can’t find anything that fixes my problem. Hopefully someone can help out.

    First and foremost my server config is:

    PHP: 5.2.4
    mySQL: 5.0.41
    server: Zeus 4.3 <-- please note

    On the Home Page of my site I have three CHUNKS all written in french. For example, one of them includes the following code:

    Un équipement diversifié et une pensée originale relèvent les défis posés par la manutention de chaque charge.


    and appears normally on the web site WHEN THE CACHE IS EMPTY:



    After saving another document, or doing some other action requiring the cache files to be written too, the following appears on my site:



    I’ve tried everything I can think of...even disabling caching completely (using http://modxcms.com/forums/index.php/topic,870.msg5517.html#msg5517), but that doesn’t seem to work (cache is still written too - maybe a Zeus thing)

    I can’t seem to fix this. I’m sure it has something to do with the charset, but I don’t know enough about that. Is there anyone who can shed light on this for me??
    Please keep in mind its a Zeus server...if that matters.

    Oh...and the main content of a page appears with the correct accents, but snippets or chunks don’t.

    Glenn



      • 16610
      • 634 Posts
        Mikko Lammi, Owner at Maagit
        • 3749
        • 24,544 Posts
        Character sets involve a complex interaction between the character set MODX thinks is being used, the character set declared in the HTML header, the character set and collation used by the MySQL server and client, the character set and collation setting of the database, the character set of the specific table in the database, the character set of the specific field in the database, the character set of the actual data in the table’s fields, and how the specific browser responds to what it gets.

        It’s a mess and I don’t pretend to understand it. I’m beginning to wonder if anyone does.

        You can see what MODx thinks the set is by looking in the System Settings -- that should match what’s in the HTML header automatically. If you go into PhpMyAdmin (assuming that that’s available to you) you can see the internal settings in the Database. The PhpMyAdmin screen will tell you about what the it’s using as the default character set and collation. If you click on "Show MySQP System Variabls," you’ll see some more settings. Looking at the structure of your MODx database will give a listing of what each table is set to.  Browsing the individual table in the DB with your data in will show you the setting for the content field.

        It’s tempting to change the settings inside the DB, but it usually won’t help because it doesn’t change the actual characters stored and can make things worse.

        Either UTF-8 or Latin1 (the most common settings) should show French characters correctly, but a lot of people seem to be having trouble with non-English characters. AFAIK, the character code for the French accented characters is the same in both so I’ve never understood why mismatches cause trouble.

        One poster with a similar problem solved it by looking in the DB and writing down *everything* and then doing an install, selecting the "custom" radio button instead of
        "update" and then filling in all those values. In that specific case, it was the "collation" that was off.

        [Update: Lammikko posted while I was writing this. Definitely try that suggestion first. wink ]

        Hope this helps,

        Bob
          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
          • 27708 MODX Staff
          • 2,502 Posts
          I had the same problem of a character set mismatch between modx and the db. The db was set for latin_swedish_ci which seems to be some sort of weird default and once I changed the collation to utf8_general_ci all was good.

          Cheers,

          Jay
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 6726
            • 7,075 Posts
            Indeed no need to apply the fix above, but run the installer in advanced mode and make sure your collation is properly set.

            There are several threads in the french boards about this, like this one :
            http://modxcms.com/forums/index.php/topic,30986.msg187788.html#msg187788

            Also since you read english, this post from Jason :
            http://modxcms.com/forums/index.php/topic,29760.msg180851.html#msg180851
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 22640
              • 44 Posts
              Thanks everyone for your input on this issue. I will be reading through all of the responses in closer detail this afternoon and give them a shot. I’ll post what worked (providing one does smiley

              Glenn
                • 22640
                • 44 Posts
                I’d like to thank everyone with their responses to my post.

                I tried a couple of solutions to no avail. However, when I became curious and looked at the code causing the problem, I noticed the french characters with the accents were not written using the french HTML character entities. When I changed them they worked! It was as simple as that.

                Thanks for your posts...there is some interesting reading in there and I hope my post helps people in the future smiley

                Glenn
                  • 6726
                  • 7,075 Posts
                  You shouldn’t have to use HTML entities... it’s most definitely an encoding issue, I know I banged my head once with this but it can be solved smiley
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l&#39;outil id