From 21b0b22a2c32e1a32dea2fcc7f9efb98cad72f1d Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Thu, 7 Jan 2021 14:35:59 +0100 Subject: [PATCH] Update HPacket.java --- G-Earth/src/main/java/gearth/protocol/HPacket.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/G-Earth/src/main/java/gearth/protocol/HPacket.java b/G-Earth/src/main/java/gearth/protocol/HPacket.java index 4b2bf1c..08cf1d2 100644 --- a/G-Earth/src/main/java/gearth/protocol/HPacket.java +++ b/G-Earth/src/main/java/gearth/protocol/HPacket.java @@ -491,7 +491,6 @@ public class HPacket implements StringifyAble { return this; } public HPacket appendString(String s) { - s = new String(s.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1); return appendString(s, StandardCharsets.ISO_8859_1); } @@ -516,7 +515,7 @@ public class HPacket implements StringifyAble { appendInt((Integer)o); } else if (o instanceof String) { - appendString((String)o); + appendString((String)o, StandardCharsets.UTF_8); } else if (o instanceof Boolean) { appendBoolean((Boolean) o); @@ -618,4 +617,4 @@ public class HPacket implements StringifyAble { System.out.println(packetverify.toString().equals(packet.toString())); } -} \ No newline at end of file +}