Offroaders123 / NBTify

A library to read and write NBT files on the web!
http://npm.im/nbtify
MIT License
30 stars 3 forks source link

Modified UTF-8 (MUTF-8) #42

Open Offroaders123 opened 7 months ago

Offroaders123 commented 7 months ago

Tonight, we (Minecraft Manipulator) were discussing the NBT spec's use of the Java version of UTF-8, which is called MUTF-8, or Modified UTF-8. I have been meaning to look into the details about this and how it relates to NBT, so I'm glad that it came up in conversation again!

Found this JS implementation, which I will try to use for inspiration to add support for the format in NBTify, as it is inherent that strings will serialize correctly in the same fashion to how they do in the base game as well.

mutf-8 - GitHub What does it mean to say "Java Modified UTF-8 Encoding"? - Stack Overflow Modified UTF-8 - Wikipedia

Offroaders123 commented 2 months ago

I think we're nearly there! I'm leaning towards getting used to adding dependencies to the project, I haven't done that for modules I share yet. It was new initially to do that with my apps, but now I think I'm going to start doing it with my npm packages too.