Fix string encoding to UTF-8

This commit is contained in:
themode 2021-02-01 23:39:44 +01:00
parent dd1b67e5de
commit 7843f74b4b

View File

@ -18,6 +18,7 @@ import org.jglrxavpok.hephaistos.nbt.NBTReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.UUID; import java.util.UUID;
/** /**
@ -94,7 +95,7 @@ public class BinaryReader extends InputStream {
"String length (" + length + ") was higher than the max length of " + maxLength); "String length (" + length + ") was higher than the max length of " + maxLength);
final byte[] bytes = readBytes(length); final byte[] bytes = readBytes(length);
return new String(bytes); return new String(bytes, StandardCharsets.UTF_8);
} }
public byte[] readBytes(int length) { public byte[] readBytes(int length) {