You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
BenWoodworth
changed the title
Support Char serializarion
Support Char serialization
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
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 correctlyThe text was updated successfully, but these errors were encountered: