NBT does not use UTF-8, it's MUTF-8.
See original GitHub issueNBT uses MUTF-8, not UTF-8. Valid game-generated files will result in UnicodeDecodeErrors
when using Twoolie’s NBT. Minimal reproduction file with an embedded MUTF-8 NULL
: encoded.dat.gz
I’d normally send you a PR to use my MUTF-8 encoder, but being dependency-free seems to be a project goal. There’s a pure-python version in there you can just copy.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
Minecraft NBT (Named Binary Tag) format spec for Kaitai Struct
A MUTF-8-encoded string containing these code points cannot be successfully decoded as UTF-8. The behavior in this case depends on the target language...
Read more >PDO + MySQL and broken UTF-8 encoding - Stack Overflow
In my own framework, after I create the PDO connection, I send two queries – SET NAMES utf8 and SET CHARACTER SET utf8...
Read more >hematite-nbt: Versions | Openbase
Compiling with the preserve_order feature will use an IndexMap instead of a HashMap ... although it should not in theory affect well-behaved NBT...
Read more >[perl #120451] perlpod not reading utf-8 on ... - Mailing List Archive
"=encoding utf-8" at the beginning of it's pod section. ... [Please do not change anything below this line] ... PERL5OPT=-Mutf8 -CSA -I/home/law/bin/lib
Read more >Perl UTF-8 crash course | by Tatsuhiko Miyagawa
Mixing in wide characters without properly encoding is a bug in your part, not perl's.You'll see “Wide characters in print…” if you don't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since this library wants to be dependency free, and py2.7 compatible (which
mutf8
is not), instead of a PR here’s a patch anyone stumbling on this with an unreadable file can use (as long as you’re py3):Still getting the same issue though: