I'm observing some strange MySQL behavior for VARCHAR fields that contain a single emoji. The connection, database and column are all utf8mb4 encoding and collation.
There's a table called categories
with id
and title
fields. There's three rows, with titles of 💳, 🍌 and 🎁.
When I run a query looking for a row with the title 💳, I get all the other rows with single emojis as well, as if MySQL is treating them as the same characters.
The expected behaviour should be that only the row with 💳 is returned.
You need the collation utf8mb4_unicode_520_ci
; the older collations treat Emoji as equal.