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

FormatException: Encoded surrogate (at offset 12) #14

Open
HuyNguyen1590 opened this issue Sep 27, 2024 · 3 comments
Open

FormatException: Encoded surrogate (at offset 12) #14

HuyNguyen1590 opened this issue Sep 27, 2024 · 3 comments

Comments

@HuyNguyen1590
Copy link

Please check this nbt file
minecraft_building.zip
When i using visual code to read, it all fine. The endianness is little.
Screenshot 2024-09-27 at 17 17 45
Screenshot 2024-09-27 at 17 17 54
But the code below return the error: FormatException: Encoded surrogate (at offset 12)
var result = await FilePicker.platform.pickFiles(allowMultiple: false); File f = File(result!.files.first.path!); final nbtReader = NbtReader.fromFile(f.path); nbtReader.setEndianness = Endian.little; nbtReader.read(); NbtCompound rootNode = nbtReader.root!;

@HuyNguyen1590
Copy link
Author

Using nbtReader.setEndianness = Endian.host is return a same error

@spnda
Copy link
Owner

spnda commented Sep 28, 2024

Do you have a call stack for when the exception/error got thrown? Also since it's little endian I'll assume this is a NBT file from Bedrock? In that case you should be using setEndianness = Endian.little since most modern computers use big endianness.

@HuyNguyen1590
Copy link
Author

HuyNguyen1590 commented Sep 28, 2024 via email

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

2 participants