RFR: JDK-8166535: jshell tool: cannot handle non-ascii characters
Jan Lahoda
jan.lahoda at oracle.com
Fri Jan 27 15:28:11 UTC 2017
Hi,
This is a basic patch to handle non-ASCII characters on Windows. The
main change is use of ReadConsoleInputW instead of the current
ReadConsoleInput. This should ensure the read characters are Unicode as
opposed to current ASCII.
So, if a non-ASCII character is typed, and is supported by the default
encoding and the console output encoding, it should work.
If the character is not supported by the default encoding, it will still
be turned into '?'. AFAIK, this is consistent with JLine behavior (the
code patched here is our replacement for jansi used by JLine). This
differs from System.in behavior, where the unsupported characters with
diacritics are converted to equivalent characters without diacritics. I
think we could try to improve that in the future (I did some
experiments, but the results were not perfect so far).
For Linux, I am afraid I didn't see the problem there - I'll file a
separate bug to investigate.
Bug: https://bugs.openjdk.java.net/browse/JDK-8166535
Webrev:
http://cr.openjdk.java.net/~jlahoda/8166535/webrev.00/
Thanks,
Jan
More information about the kulla-dev
mailing list