We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8482
    • 3 Posts
    To allow utf-8 aliases in Japanese (and multibyte characters encoding in general), besides commenting the line as stated in the first post of this thread, you also need to alter access to the DB to have ModX to store "real" utf-8 characters in the database:

    Basically, what I did is below each line like:
    @mysql_query("SET CHARACTER SET {$database_connection_charset}");

    I added the following lines:
    // set encoding information
    @mysql_query("SET NAMES 'utf8'") or die("Could not run set names.\n");
    @mysql_query("SET character_set_server = utf8") or die("Could not set character set.\n");


    Now, aliases are automatically urlencoded and the pages are retrieved normally.
    It’s dirty, but it runs!
      • 22303 MODX Staff
      • 10,725 Posts
      Edo999:

      That indicates to me that you are storing data into a database with the wrong collation/character set. SET CHARACTER SET is the same as SET NAMES except it will always set the connection character set to what your database is. So if your database is not set to one of the utf8 collations, SET CHARACTER SET alone will not work as it will now be returning results in whatever character set your database has specified; you would need to alter your database and the tables in it to be utf8. The reason applying SET NAMES is working is because it ignores what the database setting is and does conversion at the MySQL level (this is not lossless conversion either).

      I could be wrong, but that is my gut reaction based on the information you’ve provided.