XF 2.2 Emoji are not displayed when using DB ReplicationAdapter

callfilter

New member
Hi everyone, I've discovered the following bug.

My forum names contain emoji (Unicode, country flags) and it works fine when using the standard database adapter

1717936481174.webp

But recently I tried switching to ReplicationAdapter (XF\Db\Mysqli\ReplicationAdapter). Immediately after switching all the emoji disappeared and instead of them two question marks "??"

1717936581098.webp

What I've tried:

1. Add the emoji to the forum names again through the admin panel (unsuccessful)
2. Use the parameter $config['fullUnicode'] = true; in different places (unsuccessful).

I am using fully managed mysql from DigitalOcean.

DB configuration:

PHP:
<?php
$config['db']['adapterClass'] = 'XF\Db\Mysqli\ReplicationAdapter';
$config['fullUnicode'] = true;
$config['db']['write'] = [
    'host' => '*******.ondigitalocean.com',
    'port' => '25060',
    'username' => '*****',
    'password' => '*****',
    'dbname' => '*****',
    'fullUnicode' => true

];
$config['db']['read'] = [
    'host' => '*****.ondigitalocean.com',
    'port' => '25060',
    'username' => '******',
    'password' => '******',
    'dbname' => '*****',
    'fullUnicode' => true
];
 
Last edited:
The fullUnicode option you're passing to each of the adapters isn't needed. The $config['fullUnicode'] = true; line applies to both.

The ? being rendered likely means that's how they are stored in the database itself. If you imported the original source database into the replicated database then it's likely that import was done without care to ensure the unicode characters were kept when backing up the database, or it wasn't imported into a database with the correct character set.

We'd recommend starting everything from scratch, going back to just a single database connection, making sure that works, before dumping the live database and importing it into the replicated server.

This may help, I'd bet this is what you ran into:
 

Similar threads

Back
Top Bottom