It's a little bit ugly, because we're storing everything as UTF-8 internally. We should probably change it all to UCS-4, and convert to (and from) UTF-8 at the last (resp. first) moment. However, that'd be a big overhaul, and it's not clear what we should do when the input is malformed as UTF-8. The present solution works for now, but it's one of those bits of code you *really* hope won't break and need maintenance.
Also fixes the \\\\\\\\\\\\\\\\\\\\\\ colour bug
Fixes: Issue 9