kode54/quassel — pull request #3 by aziraphale (2014-04-09 20:26:32+00:00)
Title: MySQL `utf8mb4` support (high-end Unicode, e.g. emoji, support) (take 2!)

Now that your code has been rebased on Quassel 0.9, my pull request for utf8mb4 support can be nice and small! :) I think it should work with Quassel 0.10, too (the same changes apply cleanly to 0.10, and compile, though I've yet to test it in production).

The description I supplied with my [original pull request](https://github.com/kode54/quassel/pull/1):
> I've updated the DB and fixed the MySQL backend code to use MySQL's utf8mb4 character set, thus allowing for UTF-8 characters encoded as 4 bytes to be stored (currently they'll actually cause the message to be truncated in the DB - they'll display fine until you reconnect, as Quassel sends the message to clients straight from its internal memory without going via the DB, but as soon as you reconnect you get the broken messages from the DB).
>
> This adds a dependency on MySQL 5.5.3+, unfortunately, but I feel that truncated messages are a pretty serious bug that needed fixing urgently.
>
> This also means that emoji can now be stored correctly in the DB :)
>
> Also, to migrate an existing installation to use this code, you'll obviously have to run an ALTER TABLE statement on your DB to convert the message column in the backlog table to use the utf8mb4 character set: message TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin. This will understandably take a while depending on your backlog table size and server speed - it took a minute or so for my table with ~130 million records.
>
> I have this code successfully running on two cores so I'm quite confident in its stability :)

This pull request probably also addresses the bug mentioned in your [pull request #2](https://github.com/kode54/quassel/pull/2), as I needed to fix that to get this code to compile for 0.9.