-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Java terminal app doesn't scan Cyrillic script. #11168
Comments
This looks like a problem in the Windows version of Java? Your screenshots illustrate that the Console and Terminal are properly passing input to Java when it is running under WSL (so: Linux java works fine! 😄)... so it seems like this is a "Java on Windows" bug. You may need to file this upstream with them. |
Thanks for the quick reply, I can assume it's just a Java bug, but it does work fine in Eclipse/IntelliJ terminal. By the way, as you can see on screenshot n.2 it doesn't really work correctly under WSL Ubuntu. |
I think this is probably related to / the same as #4551. See a screenshot of it working below if you echo the Cyrillic text and then pipe it into the Java process (I removed the reading of the Latin string for ease of demo). Source: import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String wordCyrillic = input.nextLine();//!Привет
System.out.println("we print: " + wordCyrillic);
System.out.println("Expected bytes " + Arrays.toString("!Привет ".getBytes(StandardCharsets.UTF_8)));
System.out.println("Got bytes " + Arrays.toString(wordCyrillic.getBytes(StandardCharsets.UTF_8)));
System.out.println("we print: " + "\u26a1\u2661");
System.out.println("we print: " + "Привет");
}
}
|
Thanks for all the comprehensive investigating! 😄 I'm going to call this a /dupe of #4551. |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Windows Terminal version (or Windows build number)
Windows Terminal Version: 1.9.1942.0
Other Software
Steps to reproduce
import java.util.Scanner;
class App {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String wordCyrillic = input.nextLine();//!Привет
String wordLatin = input.nextLine(); //!hello
System.out.println("we print: " + wordCyrillic);
System.out.println("we print: " + wordLatin);
System.out.println("we print: " + "\u26a1\u2661");
System.out.println("we print: " + "Привет");
}
}
Expected Behavior
I expect it to scan the Cyrillic script properly as the Ubuntu terminal does.
Actual Behavior
Terminal doesn't scan the Cyrillic script at all.
The text was updated successfully, but these errors were encountered: