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

    I have been asked to upgrade a website to 1.0.12 and have stumbled across a problem.

    If umlauts are used in any of the page settings (menu title, long title etc.) other than the page title, they don't render correctly in the manager tree or in the front end.

    I haven't seen this problem before, so I presume it's cropped in since 1.x

    The page title renders the umlauts in the browser as they should e.g. ü

    Whereas, umlauts in the menu title. long title etc. are rendered as: ü

    In this case the "&" is rendered as: & amp; and then the uuml; is added (note: had to add a space in between the & and amp; otherwise it gets rendered properly.)

    Has anyone else experienced this ?
    Does anyone know of a fix ?

    Cheers

    This question has been answered by iusemodx. See the first response.

      • 45591
      • 18 Posts
      I'm having the same problem with 1.0.10 when using UTF-8. When using Latin-1 (same MODx installation on a different host), everything works fine.

        • 3749
        • 24,544 Posts
        This could be an issue with the encoding of the database. Check the DB in PhpMyAdmin and make sure the DB, all tables, and all text fields have the same encoding as the one MODX uses.

        If not, see this: 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
          • 45591
          • 18 Posts
          Quote from: BobRay at Nov 02, 2013, 10:08 PM
          This could be an issue with the encoding of the database. Check the DB in PhpMyAdmin and make sure the DB, all tables, and all text fields have the same encoding as the one MODX uses.

          All tables are UTF-8.

          Quote from: BobRay at Nov 02, 2013, 10:08 PM
          If not, see this: http://bobsguides.com/convert-db-utf8.html

          Thanks, but I can’t see how this should help. My SQL dump containts Unicode-characters, I don’t see how converting should help.
            • 3749
            • 24,544 Posts
            If the database and all tables are UTF-8 *and* the text fields in them are UTF-8 *and* MODX is set to use UTF-8 in the config file, your problem is likely somewhere else, though in my experience incorrect character rendering is a character set problem 99% of the time.
              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
              • 45591
              • 18 Posts
              Quote from: BobRay at Nov 03, 2013, 03:21 PM
              If the database and all tables are UTF-8 *and* the text fields in them are UTF-8 *and* MODX is set to use UTF-8 in the config file, your problem is likely somewhere else, though in my experience incorrect character rendering is a character set problem 99% of the time.

              Exactly that was the problem, and it is solved now. As you wrote (and I thought before) I set in config.inc.php:

              $database_connection_charset = 'utf-8';

              but this is wrong and all special characters are garbled then. It has to be:

              $database_connection_charset = 'utf8';

              Note the missing hyphen. And now it works. Thanks for all answers.

              Oh my. This is so stupid on so many levels …
                • 3749
                • 24,544 Posts
                Don't feel bad. This confuses me all the time. It's UTF-8 or utf8, but never utf-8. MODX should probably correct this mistake when processing the config file.

                I made it a feature request: http://bugs.modx.com/issues/10307 [ed. note: BobRay last edited this post 13 years ago.]
                  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
                  • 13226
                  • 953 Posts
                  Sorry that I didn't reply sooner.

                  As the problem is on a small site, I will install from scratch, following all the advice provided here

                  Thanks for the help.
                    • 13226
                    • 953 Posts
                    I have re-installed and created the site from scratch with no difference

                    Some info:

                    Server charset: UTF-8 Unicode (utf8)

                    Table collation: utf8_general_ci

                    config.inc.php:
                    $database_connection_charset = 'utf8';
                    $database_connection_method = 'SET CHARACTER SET';

                    I am not sure if all of the text fields are utf8 as I don't know where to actualy look

                    Any ideas ?
                    Am I possibly doing something wrong ?

                    Cheers

                    UPDATE:

                    After further testing I found that (in my case) the problem is only in a couple of the Modx specific elements:

                    • Long title
                    • Description
                    • Menu title
                    [ed. note: iusemodx last edited this post 13 years ago.]
                      • 3749
                      • 24,544 Posts
                      I am not sure if all of the text fields are utf8 as I don't know where to actualy look

                      If you look at the table in PhpMyAdmin, you can see the collation of the text fields.

                      You can also use SiteCheck, which will test the character set and collation for the whole database (and a lot of other things).

                      http://bobsguides.com/sitecheck-tutorial.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