Skip to content

Conversation

@MineRobber9000
Copy link

The BMP (Basic Multilingual Plane) consists of all Unicode codepoints from U+0000 to U+FFFF. For characters in the BMP, you can encode them with a \uXXXX escape in both JSON and SNBT. However, characters outside of the BMP are encoded differently. In SNBT, you can use \Uxxxxxxxx (\U followed by 8 hex characters); in JSON, you need to encode them as UTF-16 surrogates. With this change, mecha can now properly encode these characters.

Fixes #496.

The BMP (Basic Multilingual Plane) consists of all Unicode codepoints from
U+0000 to U+FFFF. For characters in the BMP, you can encode them with a
`\uXXXX` escape in both JSON and SNBT. However, characters outside of the BMP
are encoded differently. In SNBT, you can use `\Uxxxxxxxx` (`\U` followed by
8 hex characters); in JSON, you need to encode them as UTF-16 surrogates. With
this change, mecha can now properly encode these characters.

Fixes mcbeet#496.
@rx-dev rx-dev self-requested a review January 30, 2026 18:43
@rx-dev
Copy link
Member

rx-dev commented Jan 30, 2026

https://github.com/TheShulkerBox/shulker/blob/main/src/game/duels/instance.bolt#L40-L48

tried with this with a fork, didn't seem to change anything

team add duels.team_1 "Duels Team 1"
team add duels.team_2 "Duels Team 2"
team modify duels.team_1 friendlyFire false
team modify duels.team_1 prefix "\u1f5e1 "
team modify duels.team_1 seeFriendlyInvisibles false
team modify duels.team_2 friendlyFire false
team modify duels.team_2 prefix "\u1f5e1 "
team modify duels.team_2 seeFriendlyInvisibles false

@MineRobber9000
Copy link
Author

It works on my end? Make sure you're installing specifically mecha from the fork (pip install C:\path\to\beet\packages\mecha).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unicode codepoints outside of the Basic Multilingual Plane are incorrectly encoded

3 participants