Custom emoji reactions don’t work for emojis with multi-byte characters
Environment
- Installation type (OTP or From Source): From Source
- Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): 2.5.52-305-gb08cbe76-develop
- Elixir version (
elixir -v
for from source installations, N/A for OTP): 1.14.0 - Operating system: Arch
- PostgreSQL version (
psql -V
): 15.3
Bug description
Custom emoji reactions for emojis whose names contain accented/multi-byte characters fails with {"error": "Could not add reaction emoji"}
.
For example, reacting to a post using the custom emojis “sándwhich” and “sandviĉo” fails:
$ curl -X PUT -H "Cookie: __Host-pleroma_key=$PLEROMA_KEY" https://jam.xwx.moe/api/v1/pleroma/statuses/AYKj2y6r97QfJhr5rk/reactions/:sandviĉo: | jq
{
"error": "Could not add reaction emoji"
}
$ curl -X PUT -H "Cookie: __Host-pleroma_key=$PLEROMA_KEY" https://jam.xwx.moe/api/v1/pleroma/statuses/AYKj2y6r97QfJhr5rk/reactions/:sándwhich: | jq
{
"error":"Could not add reaction emoji"
}
Despite these emojis, “sándwhich” and “sandviĉo”, both being used in the post body itself.
Custom emoji without accented characters (“todoroki_adoras” and “firefox”) work as expected, though:
$ curl -X PUT -H "Cookie: __Host-pleroma_key=$PLEROMA_KEY" https://jam.xwx.moe/api/v1/pleroma/statuses/AYKj2y6r97QfJhr5rk/reactions/:todoroki_adoras: | jq
{
[…redact…]
"emoji_reactions": [
{
"account_ids": [
"AVKUbIAGOV9ZVeJxFg"
],
"count": 1,
"me": true,
"name": "firefox",
"url": "https://jam.xwx.moe/emoji/Programaro mezlibera/firefox.png"
},
{
"account_ids": [
"AVKUbIAGOV9ZVeJxFg"
],
"count": 1,
"me": true,
"name": "todoroki_adoras",
"url": "https://jam.xwx.moe/emoji/Laborado!!/todoroki_adoras.png"
}
],
[…redact…]
}
(If it’s of any use, here is a simple emoji pack with “sándwhich” and “sandviĉo”, Testing.tar.gz.)