Skip to content

Commit 11971ab

Browse files
committed
Fix UTF-8 encoder errors
1 parent 1a19da1 commit 11971ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/testCompatKtLint0Dot48Dot1/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot48Dot1AdapterTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.io.IOException;
2121
import java.io.InputStream;
22+
import java.nio.charset.StandardCharsets;
2223
import java.nio.file.Files;
2324
import java.nio.file.Path;
2425
import java.util.HashMap;
@@ -34,7 +35,7 @@ public void testDefaults(@TempDir Path path) throws IOException {
3435
try (InputStream is = KtLintCompat0Dot48Dot1AdapterTest.class.getResourceAsStream("/empty_class_body.kt")) {
3536
Files.copy(is, path.resolve("empty_class_body.kt"));
3637
}
37-
String text = new String(Files.readAllBytes(path.resolve("empty_class_body.kt")));
38+
String text = new String(Files.readAllBytes(path.resolve("empty_class_body.kt")), StandardCharsets.UTF_8);
3839

3940
Map<String, String> userData = new HashMap<>();
4041

@@ -50,7 +51,7 @@ public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
5051
try (InputStream is = KtLintCompat0Dot48Dot1AdapterTest.class.getResourceAsStream("/fails_no_semicolons.kt")) {
5152
Files.copy(is, path.resolve("fails_no_semicolons.kt"));
5253
}
53-
String text = new String(Files.readAllBytes(path.resolve("fails_no_semicolons.kt")));
54+
String text = new String(Files.readAllBytes(path.resolve("fails_no_semicolons.kt")), StandardCharsets.UTF_8);
5455

5556
Map<String, String> userData = new HashMap<>();
5657

0 commit comments

Comments
 (0)