When I type in chinese characters in the REPL, only question marks are displayed, as in my second screenshot. How can I fix this? My scala version is 2.9.0.1 and OS windows



Even if I start REPL with a property -Dfile.encoding="UTF-8"
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ah, you’re on Windows. I don’t think this is supported at the moment. I some idea of what’s going on. See https://issues.scala-lang.org/browse/SI-4711 for the investigation.
The root of the issue is:
getcto read characters at the console and does not support double byte characters. The API call that could be used instead isReadConsoleInputW.System.outwhich does not print unicode characters reliably – although your first snapshot in your question seems to imply that it works*.I’m not part of the Scala team, but I tried to fix it and I may have something working more or less. See https://github.com/fusesource/jansi-native/blame/master/src/main/java/org/fusesource/jansi/internal/WindowsSupport.java (based on
WriteConsoleWandReadConsoleInputWand other additions in the REPLILoopsource – the changes are somewhere in my fork on github – not updated in a while.If you are interested, I may be able to provide an experimental fork of the 2.9.0.1 scala-compiler.jar and jline.jar and you could tell me if it works.
*What is the code that prints
:1: xx 2:xx 3:xx 4:x 5:xwhere x is some chinese character?