This is actually a problem occurring at the MySQL level, since the regular MySQL UTF-8 character set does not support 4-byte UTF-8 characters, of which Emoji are an example.
If you are using MySQL 5.5.3 or later, there's a character set called utf8mb4 which can be substituted for utf8, and which allows Emoji. In order to switch to this character set you need to:
-
Change the encodings in qa_db_connect(...) in qa-db.php from utf8 to utf8mb4 (two places).
-
Change the character set of columns qa_posts.content (for post content), qa_words.word (for indexing), qa_users.handle (for searching), qa_userprofile.content (for profile pages), qa_messages.content (for private message / wall posts) to utf8mb4.
-
Or if you're creating a new Q2A installation you can skip the previous step and just change utf8 to utf8mb4 in qa_db_create_table_sql(...) in qa-db-install.php before installing.
I'm not sure if it makes sense to include this in the Q2A core since the utf8mb4 character set is only supported since MySQL 5.5.3, and can take up more space in some cases.