From bde8cb4cfeeba9efcccb127214bb433f97ad76ef Mon Sep 17 00:00:00 2001 From: Dotty CI Date: Sun, 23 Dec 2018 20:45:28 +0100 Subject: [PATCH] fixed utf8 encoding when piping stdout --- compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala b/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala index 9d5dd8b6f7bf..2fb3a275402a 100644 --- a/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala +++ b/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala @@ -117,7 +117,7 @@ trait RunnerOrchestration { val sb = new StringBuilder if (childStdout eq null) - childStdout = new BufferedReader(new InputStreamReader(process.getInputStream)) + childStdout = new BufferedReader(new InputStreamReader(process.getInputStream, "UTF-8")) var childOutput: String = childStdout.readLine() @@ -127,8 +127,7 @@ trait RunnerOrchestration { childOutput = childStdout.readLine() while (childOutput != ChildJVMMain.MessageEnd && childOutput != null) { - sb.append(childOutput) - sb += '\n' + sb.append(childOutput).append(System.lineSeparator) childOutput = childStdout.readLine() } @@ -161,7 +160,7 @@ trait RunnerOrchestration { val url = classOf[ChildJVMMain].getProtectionDomain.getCodeSource.getLocation val cp = Paths.get(url.toURI).toString + JFile.pathSeparator + Properties.scalaLibrary val javaBin = sys.props("java.home") + sep + "bin" + sep + "java" - new ProcessBuilder(javaBin, "-Xmx1g", "-cp", cp, "dotty.tools.vulpix.ChildJVMMain") + new ProcessBuilder(javaBin, "-Dfile.encoding=UTF-8", "-Xmx1g", "-cp", cp, "dotty.tools.vulpix.ChildJVMMain") .redirectErrorStream(true) .redirectInput(ProcessBuilder.Redirect.PIPE) .redirectOutput(ProcessBuilder.Redirect.PIPE)