From aae0c12d3994b2eeebbdf48ffdcfdd511b15e013 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Nov 2018 00:38:35 -0500 Subject: [PATCH] Specify charset explicitly on getBytes --- Spigot-Server-Patches/0410-Book-Size-Limits.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/0410-Book-Size-Limits.patch b/Spigot-Server-Patches/0410-Book-Size-Limits.patch index f153032d22..bcaf5da5d5 100644 --- a/Spigot-Server-Patches/0410-Book-Size-Limits.patch +++ b/Spigot-Server-Patches/0410-Book-Size-Limits.patch @@ -39,7 +39,7 @@ index 3427e95e60..462ab49762 100644 + long byteAllowed = maxBookPageSize; + for (int i = 0; i < pageList.size(); ++i) { + String testString = pageList.getString(i); -+ int byteLength = testString.getBytes().length; ++ int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; + byteTotal += byteLength; + if (byteTotal > byteAllowed) { + PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());