8️⃣ enforce utf-8 within stream write

Took 2 minutes
This commit is contained in:
Kiran Hart 2023-02-19 09:31:01 -05:00
parent c91ace0804
commit 1dfd00dbcb
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3

View File

@ -24,6 +24,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.*;
@ -158,7 +159,7 @@ public class DiscordWebhook {
connection.setRequestMethod("POST");
OutputStream stream = connection.getOutputStream();
stream.write(json.toString().getBytes());
stream.write(json.toString().getBytes(StandardCharsets.UTF_8));
stream.flush();
stream.close();