by danso · 9y ago · 0 comments
The search for the fix -- which is that MySQL has a utf8mb4 encoding for 4-bytes -- was probably the most frustrating debugging exercise in my career. Even worse was the eventual revelation that the MySQL devs were technically right -- the UTF8 spec says nothing about requiring 4 bytes, and 3 bytes probably seemed sensible enough in terms of efficiency at the time of MySQL 4.
In UTF-8, characters from the U+0000..U+10FFFF range (the UTF-16
accessible range) are encoded using sequences of 1 to 4 octets.
It would be absurd for an encoding that's used by 88.9% of the web [2] to be implemented in a way that doesn't respect the standard.