Respect charset when loading scripts

This commit is contained in:
P0nk
2021-09-08 18:46:16 +02:00
parent 1803699086
commit c841e9952b
8 changed files with 11 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ public class ByteBufInPacket implements InPacket {
short length = readShort();
byte[] stringBytes = new byte[length];
byteBuf.readBytes(stringBytes);
return new String(stringBytes, CharsetConstants.PACKET_CHARSET);
return new String(stringBytes, CharsetConstants.CHARSET);
}
@Override

View File

@@ -78,12 +78,12 @@ public class ByteBufOutPacket implements OutPacket {
@Override
public void writeString(String value) {
writeShort((short) value.length());
writeBytes(value.getBytes(CharsetConstants.PACKET_CHARSET));
writeBytes(value.getBytes(CharsetConstants.CHARSET));
}
@Override
public void writeFixedString(String value) {
writeBytes(value.getBytes(CharsetConstants.PACKET_CHARSET));
writeBytes(value.getBytes(CharsetConstants.CHARSET));
}
@Override