Use UTF-8 charset for string -> bytes conversion

This commit is contained in:
RaphiMC 2023-04-13 16:32:56 +02:00
parent c4c0a9dcdd
commit 55ca5c7087

View File

@ -20,6 +20,7 @@ package net.raphimc.viaproxy.saves.impl.accounts;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import java.nio.charset.StandardCharsets;
import java.util.UUID; import java.util.UUID;
public class OfflineAccount extends Account { public class OfflineAccount extends Account {
@ -34,7 +35,7 @@ public class OfflineAccount extends Account {
public OfflineAccount(final String name) { public OfflineAccount(final String name) {
this.name = name; this.name = name;
this.uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes()); this.uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(StandardCharsets.UTF_8));
} }
@Override @Override