Paul:
I'd recommend more reading in a dedicated Manual Chapter; you could use some test scripts to analyze your database.
...
Take care of your mySQL version.
I am glad it works and I do not mind a bit of black magic in the background which I do not fully understand. :)
I tried to post the same emoji to several forums. miniBB demo forum works well. This forum works well too (test β π±π«). Even my prehistoric installation still running 10 year old version of miniBB with no mention of utf8mb4 anywhere works well (stores and shows problematic emojis correctly, without need to change any default setting):
--
1) Old semi-abandoned forum, miniBB 2.5a, MySQL 5.5.60, miniBB tables created with utf8_general_ci collation, there is no $mysql_set_charset in setup_options.php.
dbs_check.php says:
character_set_client: latin1
character_set_connection: latin1
character_set_database: latin1
character_set_filesystem: binary
character_set_results: latin1
character_set_server: latin1
character_set_system: utf8
character_sets_dir: /usr/share/mysql/charsets/
collation_connection: latin1_swedish_ci
collation_database: latin1_swedish_ci
collation_server: latin1_swedish_ciEmojis work flawlessly.
--
2) Current actively used forum, miniBB 3.4.2, MariaDB 10.3.17, miniBB tables created with utf8_czech_ci collation, $mysql_set_charset was set to 'utf8' in setup_options.php.
dbs_check.php says:
character_set_client: utf8mb4
character_set_connection: utf8mb4
character_set_database: utf8
character_set_filesystem: binary
character_set_results: utf8mb4
character_set_server: latin1
character_set_system: utf8
character_sets_dir: /usr/share/mariadb/charsets/
collation_connection: utf8mb4_general_ci
collation_database: utf8_czech_ci
collation_server: latin1_swedish_ciSome emojis cannot be used in posts (they cause "white screen of death" with SQL command and database error displayed).
Only after I did the abovementioned 2 things, i. e.
β changed collation of table columns (in tables 'posts' and 'topics') to utf8mb4_czech_ci
β set $mysql_set_charset = 'utf8mb4' in setup_options.php
it started working as expected. Only altering tables (without changing $mysql_set_charset) was not enough.
When I remove the variable $mysql_set_charset from setup_options.php, all posts turn to gibberish.
Setting $mysql_set_charset = 'utf8' turns gibberish to Czech.
Setting $mysql_set_charset = 'utf8mb4' turns gibberish to Czech too and in addition it allows using problematic emojis; but I need to change collation of table columns to utf8mb4_czech_ci also, $mysql_set_charset = 'utf8mb4' alone is not enough.
--
So these are my observations, but I am afraid there is not much universal truth in them.