Skip to content

Commit

Permalink
Read sources using the UTF_8 charset during hot reload compilation
Browse files Browse the repository at this point in the history
gwenneg committed Aug 9, 2019
1 parent 5de2bed commit 6c2790f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -42,7 +43,8 @@ public void compile(Set<File> filesToCompile, Context context) {
throw new RuntimeException("No system java compiler provided");
}
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
try (StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);) {
try (StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null,
StandardCharsets.UTF_8)) {

fileManager.setLocation(StandardLocation.CLASS_PATH, context.getClasspath());
fileManager.setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(context.getOutputDirectory()));

0 comments on commit 6c2790f

Please sign in to comment.