We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33337
    • 3,975 Posts
    As the title states, I just discovered that there is no [(modx_charset)] in MODx anymore.

    Is this intentional? or just a mistake.

    Thanks.
      Zaigham R - MODX Professional | Skype | Email | Twitter

      Digging the interwebs for #MODX gems and bringing it to you. modx.link
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      What revision? I’ve got 5299, and it has it...

      Ok, just grabbed the latest from svn, and indeed it’s not there in the setup.sql file.

      However, the parser still wants to use it; line 467
                  header('Content-Type: ' . $type . '; charset=' . $modx_charset);
        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
        • 21257 MODX Staff
        • 730 Posts
        An issue affecting this setting is in progress..
        http://svn.modxcms.com/jira/browse/MODX-916
        Thoughts or suggestions in jira are most welcome.
          Mike Schell
          Lead Developer, MODX Cloud
          Email: [email protected]
          GitHub: https://github.com/netProphET/
          Twitter: @mkschell
          • 25663 MODX Staff
          • 12,272 Posts
          Assume you have a multi-language site with different character sets for different languages. What happens when the wrong value is returned since the character set value in the database is only for the default Manager language. I think the appropriate solution is to write a custom snippet to dynamically substitute those or a plugin that sets a placeholder.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I commented something similar in jira. Maybe still have the default, since the vast majority of sites will only want the one charset, have the ability to override for the manager on a per-user basis (as many other default site configurations do), and use TVs and plugins to set overrides on a per-document or per-section (@INHERIT) basis.
              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
              • 25663 MODX Staff
              • 12,272 Posts
              I’m probably just tired, but I’m struggling trying to come up with an instance where using [(modx_charset)] vs it’s value in the front end would make sense? Typical front end users are not going to be logged into the manager, so the "default" value is all that would ever be seen, and to date that’s been hard coded to UTF-8 based on the installation script.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                The usefulness of using it is in making sure that the headers sent match the meta data in the document HTML head. I don’t know if it really makes any difference, but it does cause a validation warning if they don’t match.
                  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
                  • 25663 MODX Staff
                  • 12,272 Posts
                  But my question is more about [(modx_charset)] vs. a plain static UTF-8, which is what is inserted in the MODx database anyway. Or if you build your templates, just setting it properly to begin with since most likely you’ll know to do that if you’re deviating from common UTF-8 stuff anyway.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 33337
                    • 3,975 Posts
                    Just FYI, we used this in the demo content, and probably most of the templates are distributed, with [(modx_charset)] in the head tag. I see your point in putting the UTF-8 or whatever used manually, but releasing Evo with this not in there, would make site validation break whoever used this tag. (I used this everywhere!) ..

                    I discovered this when I was testing ditto calls on the demo content that, the RSS template Ditto use has this tag in it, thus failing the RSS feed.
                      Zaigham R - MODX Professional | Skype | Email | Twitter

                      Digging the interwebs for #MODX gems and bringing it to you. modx.link
                      • 33337
                      • 3,975 Posts
                      BTW: here is the Ditto bits,
                      <?php
                      
                      $rss_placeholders['rss_charset'] = isset($charset) ? $charset : $modx_charset;
                      /*
                      	Param: charset
                      
                      	Purpose:
                      	Charset to use for the RSS feed
                      
                      	Options:
                      	Any valid charset identifier
                      
                      	Default:
                      	MODx default charset
                      */
                      
                      ?>
                      


                      If I make it like below, is it correct?

                      <?php
                      
                      $rss_placeholders['rss_charset'] = isset($charset) ? $charset : "UTF-8";  // <---
                      /*
                      	Param: charset
                      
                      	Purpose:
                      	Charset to use for the RSS feed
                      
                      	Options:
                      	Any valid charset identifier
                      
                      	Default:
                      	MODx default charset
                      */
                      
                      ?>
                      
                        Zaigham R - MODX Professional | Skype | Email | Twitter

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link