Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8274784: jshell: Garbled character was displayed by System.out.println(...) on Japanese Windows #6505

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -55,7 +55,7 @@ public AbstractTerminal(String name, String type) throws IOException {
public AbstractTerminal(String name, String type, Charset encoding, SignalHandler signalHandler) throws IOException {
this.name = name;
this.type = type != null ? type : "ansi";
this.encoding = encoding != null ? encoding : Charset.defaultCharset();
this.encoding = encoding != null ? encoding : System.out.charset();
for (Signal signal : Signal.values()) {
handlers.put(signal, signalHandler);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,8 @@ public static void main(String[] args) throws Exception {
InputStream inStream = socket.getInputStream();
OutputStream outStream = socket.getOutputStream();
Map<String, Consumer<OutputStream>> outputs = new HashMap<>();
outputs.put("out", st -> System.setOut(new PrintStream(st, true)));
outputs.put("err", st -> System.setErr(new PrintStream(st, true)));
outputs.put("out", st -> System.setOut(new PrintStream(st, true, System.out.charset())));
outputs.put("err", st -> System.setErr(new PrintStream(st, true, System.err.charset())));
Map<String, Consumer<InputStream>> input = new HashMap<>();
input.put("in", System::setIn);
forwardExecutionControlAndIO(new RemoteExecutionControl(), inStream, outStream, outputs, input);