Fixing utf8 in Wayfinder

I’m currently setting up a Swedish site for a friend, this time I changed site language in the backend to Swedish and utf8. The database collation is set to utf8 too, and the charset line in the config file looks like this: $database_connection_charset = ‘utf8’;

It still wouldn’t work, special Swedish vowels still ended up garbled in the menu, only in the menu which is the domain of Wayfinder.

Changing the very last lines in the snippet did it though, they now look like this:

//Ouput Results
if ($wf->_config['ph']) {
    $modx->setPlaceholder($wf->_config['ph'], utf8_encode($output));
} else {
    return utf8_encode($output);

Update: I just changed the language in the backend to English, still keeping utf8 as the encoding and everything just works, even the original Wayfinder without the above changes, weird…

Update: And it gets weirder, somehow it just wouldn’t work with special characters in for instance [(site_name)]. I ended up creating a chunk with the special characters html encoded instead.

Related Posts

Tags: , ,