Skip to content

Commit

Permalink
Merge pull request #3471 from gwenneg/issue-3467-fix-hot-reload-charset
Browse files Browse the repository at this point in the history
Read sources using the UTF_8 charset during hot reload compilation
  • Loading branch information
gsmet authored Aug 12, 2019
2 parents c22e0de + 6c2790f commit deb0672
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit deb0672

Please sign in to comment.