We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Quote from: suvit at Oct 02, 2008, 04:30 AM

    Do you means that russian.inc.php must be renamed to russian-cp1251.inc.php, and russian-UTF8.inc.php must be renamed to russian.inc.php? This brings more work, because third-party plugins and modules uses russian.inc.php files for cp1251 encoding.
    Just an opinion, not a call to action (yet).
    • I’ll stick my oar in here as well; it seems to me that the default should be utf8, and anything else should need a specific indication in the filename.
        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
        • 3785
        • 143 Posts
        Hi everyone!

        Just a short update on this topic: I just downloaded latest SVN version and installed it on my server (PHP 5.1.2 / MySQL 5.0.26). Both the database and MODx are set to UTF-8. When I insert a russian Word like "Предлагаем" into a document and save it I get "??????????" when I reopen the same document in the manager.

        I tried this in older MODx installations and it works perfectly in 0.9.5 and 0.9.6.1.

        I don’t know what causes this problems in 0.9.6.2 and the RCs of 0.9.6.3 but I hope it can be fixed.

        Thanks,
        Bogdan
          Medianotions – Studio für Webdesign
          http://www.medianotions.de
        • Quote from: Bogdan at Dec 04, 2008, 10:23 AM

          Hi everyone!

          Just a short update on this topic: I just downloaded latest SVN version and installed it on my server (PHP 5.1.2 / MySQL 5.0.26). Both the database and MODx are set to UTF-8. When I insert a russian Word like "Предлагаем" into a document and save it I get "??????????" when I reopen the same document in the manager.

          I tried this in older MODx installations and it works perfectly in 0.9.5 and 0.9.6.1.

          I don’t know what causes this problems in 0.9.6.2 and the RCs of 0.9.6.3 but I hope it can be fixed.

          Thanks,
          Bogdan

          Hi Bogdan,

          This is what I do always to avoid such issues with encoding:

          1. open phpMyAdmin and find the database that will be used (left side, drop-down box). check the default encoding - on the right side (of course, you should select your database before in the drop-down box) click on the tab Operations and you will see there drop-down box named "Colllation". Usually it will be latin1_swedish_ci. Change if to utf8_general_ci and click on the button "Go"

          2. find the file index.php in the folder "manager", open it and find the string @mysql_query("{$database_connection_method} {$database_connection_charset}");
          it will be on 141 line or smth like that.
          add before the next strings:

          mysql_query("SET NAMES ’utf8’;",$modxDBConn);
          mysql_query("SET CHARACTER SET ’utf8’;",$modxDBConn);
          mysql_query("SET SESSION collation_connection = ’utf8_general_ci’;",$modxDBConn);

          so you should see smth like:

          mysql_select_db($dbase);
          mysql_query("SET NAMES ’utf8’;",$modxDBConn);
          mysql_query("SET CHARACTER SET ’utf8’;",$modxDBConn);
          mysql_query("SET SESSION collation_connection = ’utf8_general_ci’;",$modxDBConn);
          @mysql_query("{$database_connection_method} {$database_connection_charset}");

          save this file.

          3. find the file dbapi.mysql.class.inc.php in the folder "manager/includes/extenders/"

          open it and find

          @mysql_query("{$database_connection_method} {$charset}", $this->conn);

          add before

          mysql_query("SET NAMES ’utf8’;", $this->conn);
          mysql_query("SET character_set_results = ’utf8’;", $this->conn);
          mysql_query("SET collation_connection = ’utf8_general_ci’;", $this->conn);

          so you will see

          mysql_query("SET NAMES ’utf8’;", $this->conn);
          mysql_query("SET character_set_results = ’utf8’;", $this->conn);
          mysql_query("SET collation_connection = ’utf8_general_ci’;", $this->conn);
          @mysql_query("{$database_connection_method} {$charset}", $this->conn);

          save this file.

          That’s all.

          It will be better to do this actions before you install MODx.
          If you have already installed MODx and insterted many text content then it might be difficult to fix it.
            Разработка сайтов и программных модулей на MODX.
            Опыт работы на MODx с 2005 года. Высокое качество.
            Компания Baltic Design Colors: http://www.bdcolors.ru.
            • 3785
            • 143 Posts
            Hello Fuzzy,

            thanks for the fast help. I executed the proposed steps but unfortunately it still does not work although the databased had UTF-8 as encoding from the very beginning as I am alway using UTF-8.

            Looks like I have to use a older MODx version or insert all the russian content as HTML entities sad
              Medianotions – Studio für Webdesign
              http://www.medianotions.de
            • Quote from: Bogdan at Dec 04, 2008, 10:50 AM

              Looks like I have to use a older MODx version or insert all the russian content as HTML entities sad
              Can you check what is the version of MODx you use?
              It is always displayed in the right top corner.
                Разработка сайтов и программных модулей на MODX.
                Опыт работы на MODx с 2005 года. Высокое качество.
                Компания Baltic Design Colors: http://www.bdcolors.ru.
                • 3785
                • 143 Posts
                Its the latest SVN version of 0.9.6.3. I hoped in this very new version of MODx the encoding issues might be solved therefore I just downloaded it today.
                  Medianotions – Studio für Webdesign
                  http://www.medianotions.de
                • Quote from: Bogdan at Dec 04, 2008, 12:21 PM

                  Its the latest SVN version of 0.9.6.3. I hoped in this very new version of MODx the encoding issues might be solved therefore I just downloaded it today.
                  Well, possibly 0.9.6.3 has some changes from 0.9.6.2...
                  Try to download latest official version 0.9.6.2 and do the actions that I have described.
                  It should work.
                    Разработка сайтов и программных модулей на MODX.
                    Опыт работы на MODx с 2005 года. Высокое качество.
                    Компания Baltic Design Colors: http://www.bdcolors.ru.
                  • Fuzzy it would be great if you could give the latest SVN version a check and make sure it’s working as expected. We’d like to release it soon and don’t want to introduce inconsistencies.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • Quote from: rthrash at Dec 04, 2008, 12:36 PM

                      Fuzzy it would be great if you could give the latest SVN version a check and make sure it’s working as expected. We’d like to release it soon and don’t want to introduce inconsistencies.
                      OK, will do. But what SVN version should I use?
                      Do you mean 0.9.6.3-rc2?
                        Разработка сайтов и программных модулей на MODX.
                        Опыт работы на MODx с 2005 года. Высокое качество.
                        Компания Baltic Design Colors: http://www.bdcolors.ru.