Skip to content

Commit ddd9960

Browse files
committed
chore: specify charset for rootName
1 parent 75f6ab5 commit ddd9960

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import java.net.URL;
5252
import java.nio.channels.Channels;
5353
import java.nio.channels.ReadableByteChannel;
54+
import java.nio.charset.StandardCharsets;
5455
import java.util.ArrayList;
5556
import java.util.Arrays;
5657
import java.util.Collection;
@@ -172,7 +173,7 @@ public static ClipboardFormat findByFile(File file) {
172173
if (rootNameTagLength != 0 && rootNameTagLength != 9) { // Only allow "" and "Schematic"
173174
return findByFileInExternalFormats(file);
174175
}
175-
final String rootName = new String(inputStream.readNBytes(rootNameTagLength));
176+
final String rootName = new String(inputStream.readNBytes(rootNameTagLength), StandardCharsets.UTF_8);
176177
if (rootName.isEmpty()) {
177178
// Only FAST_V3 and MINECRAFT_STRUCTURE use empty named root compound tags
178179
// FAST_V3 only contains a single child component - if that's not present, only MINECRAFT_STRUCTURE is possible

0 commit comments

Comments
 (0)