Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Char serialization #25

Closed
BenWoodworth opened this issue Mar 12, 2023 · 0 comments
Closed

Support Char serialization #25

BenWoodworth opened this issue Mar 12, 2023 · 0 comments
Milestone

Comments

@BenWoodworth
Copy link
Owner

NBT doesn't have a tag type for single characters, but it makes sense to follow kotlinx-serialization's lead with how it handles Chars in JSON. It parses as a string (or other primitive) and fails if the length isn't 1

Char could also be encoded as a UShort since the bitlength is the same, but that doesn't seem right semantically. If someone opens the serialized NBT in an NBT viewer, the encoded char would be a number, whereas a string would show correctly

@BenWoodworth BenWoodworth changed the title Support Char serializarion Support Char serialization Mar 12, 2023
BenWoodworth added a commit that referenced this issue Mar 12, 2023
Closes #25

Similar to the way kotlinx-serialization handles it for JSON, Chars will serialize as strings, and fail when deserializing if the length isn't 1
@BenWoodworth BenWoodworth added this to the v0.12 milestone Mar 12, 2023
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

No branches or pull requests

1 participant