Need actual byte length for characters

This commit is contained in:
Manevolent
2018-08-05 00:58:21 -04:00
parent e7beee972d
commit 836a952a6d
2 changed files with 4 additions and 2 deletions
@@ -48,6 +48,6 @@ public class PacketBody2Command extends PacketBody {
@Override @Override
public int getSize() { public int getSize() {
return text.length(); return text.getBytes(Charset.forName("UTF8")).length;
} }
} }
@@ -38,7 +38,9 @@ public class ServerConnectionTest {
10000L 10000L
); );
assertEquals(client.getState(), ClientConnectionState.CONNECTED); client.sendServerMessage("\u26D4");
assertEquals(client.getState(), ClientConnectionState.CONNECTED);
for (Client c : client.listClients()) { for (Client c : client.listClients()) {
client.getClientInfo(c.getId()); client.getClientInfo(c.getId());