Replace utf8 with modified utf8.#197
Open
xymb-endcrystalme wants to merge 1 commit intovberlier:mainfrom
Open
Conversation
|
Maybe this is a problem. However, this project may also worked for some Bedrock projects, but different to Minecraft Java Edition, they seems uses standard So, here comes a problem is that, how would those projects who based on Minecraft bedrock work as well? (Because this PR looks like destroy the support of Bedrock) |
Author
|
I wasn't aware that NBT isn't a "standard" and that Bedrock used normal UTF-8. 🤣 Yea, my patch would 100% break that. To do it properly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

nbtlibis sadly broken. Minecraft uses modified UTF-8, whilenbtlibuses normal UTF-8. Reading an NBT file with UTF-8 characters and saving it again screws up texts.I admit, I did just ask o3 to write this code. However, a test with 70 region files started passing, so I suspect it's at least somewhat correct.
My test was "open a region file, open&save each chunk as nbtlib, verify contents (chunk bytes) are the same".
nbtlibwas making errors in some chunks that contained books with funny characters, after this patch it stopped. So I'll start internally using this for now.