jsonmariadb

MariaDB's JSON_UNQUOTE doesn't work with emojis?


I'm storing JSON in a varchar(255) column.

The table has DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci.

This JSON may contain Unicode characters. For example "😊" is encoded as "\\ud83d\\ude0a".

When I try to extract this value, JSON_UNQUOTE returns "?".

SELECT JSON_UNQUOTE('"\\ud83d\\ude0a"');
?

How can I extract this value in SQL?


Solution

  • Per comments, its a bug, MDEV-35614, it appears to be related to an internal representation at utf8mb3 where as smiley emoji's need a full utf8mb4.