We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3493
    • 66 Posts
    I’m having a slight problem with the way snippets encode, in my example the HyperFlexSearchForm. I’m afraid the same problem goes for the rest of the snippets too, but this has not been tested.

    My current site runs fine with UTF-8 encoding, which is set in the HTTP header, in the MODx configuration (logically enough), and I also submitted this at the database page during my MODx installation.

    HyperFlexSearchForm calls a PHP script in the assets-folder, which contains a few text variables like search button text and standard form field text. When I use the Norwegian Æ Ø Å’s, these gets changed to totally different characters instead, as if they weren’t UTF-8 at all. Feel free to take a look at my development page and try to use the search field in the top menu. The form field text should have been "Søkeord...", and there’s also a few errors in my XHTML code.

    Is this a MODx snippet parsing error, or should I address it directly to the HyperFlexSearchForm forum? Most importantly, are there any fixes for this error?

    Development page: http://www.musikerportalen.org/_dev

    Thanks (again embarrassed)
    • First, check that all php files or other file inclusions that might contain markup included on the page are saved in the proper utf-8 encoding as well.

      If that isn’t the issue, make sure you have utf8 specified as the $database_connection_charset value in your manager/includes/config.inc.php file. If that is set to utf8, then it’s likely a problem with how it is stored in the database, and you’ll need to correct it there.

      Finally, double-check the collation set on your database and the tables themselves, and make sure they are set to utf8_general_ci (or utf8_unicode_ci, or another valid utf8 collation). If it is not, you’ll need to correct that, and likely convert all the content stored in those tables, in order to be able to display it properly in a web page as UTF-8.
        • 3493
        • 66 Posts
        I’ll check it out! Thanks for your information, OpenGeek smiley