|
2 | 2 |
|
3 | 3 | import java.io.InputStream;
|
4 | 4 | import java.io.PrintStream;
|
| 5 | +import java.io.UnsupportedEncodingException; |
5 | 6 | import java.lang.ref.WeakReference;
|
6 | 7 | import java.util.HashMap;
|
7 | 8 | import java.util.HashSet;
|
@@ -186,9 +187,9 @@ public class GlobalContext {
|
186 | 187 | public ByteClassLoader byteClassLoader;
|
187 | 188 |
|
188 | 189 | /** Redirected output for eval-server. */
|
189 |
| - public PrintStream out = System.out; |
| 190 | + public PrintStream out; |
190 | 191 | /** Redirected error for eval-server. */
|
191 |
| - public PrintStream err = System.err; |
| 192 | + public PrintStream err; |
192 | 193 | /** Redirected input for eval-server. */
|
193 | 194 | public InputStream in = System.in;
|
194 | 195 | /** Whether to disallow exit. */
|
@@ -217,6 +218,14 @@ public class GlobalContext {
|
217 | 218 | */
|
218 | 219 | public GlobalContext()
|
219 | 220 | {
|
| 221 | + try { |
| 222 | + out = new PrintStream(System.out, true, "UTF-8"); |
| 223 | + err = new PrintStream(System.err, true, "UTF-8"); |
| 224 | + } |
| 225 | + catch (UnsupportedEncodingException e) { |
| 226 | + throw new RuntimeException(e); |
| 227 | + } |
| 228 | + |
220 | 229 | compileeHLLConfiguration = new HashMap<String, HLLConfig>();
|
221 | 230 | hllConfiguration = compileeHLLConfiguration;
|
222 | 231 | getHLLConfigFor("");
|
|
0 commit comments