redhat-developer / redhat-developer/vscode-java

Is there any way for the terminal used by vscode to recognize the input Greek letters

Open
#2,457 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

caused-by-extension question
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

This is a problem I saw on stack overflow.
OP have the following code:

`public static void main(String[] args) throws Exception {
System.setProperty("file.encoding","UTF-8");
System.out.println("File encoding is " + System.getProperty("file.encoding"));

Scanner console = new Scanner(new InputStreamReader(System.in, StandardCharsets.UTF_8));
PrintStream sysout = new PrintStream(System.out, true, StandardCharsets.UTF_8);

sysout.println("\nTests:");
sysout.println("Can we print lambda using unicode? Let's see: \u03BB");

sysout.print("Copy and paste the lambda above here: ");
String line = console.nextLine();

sysout.println("\nThe input consisted of " + line.length() + " character(s).");
sysout.println("The input was: " + line);

if (line.equals("λ")) {
    sysout.println("lambda (λ) was detected with .equals!");
} else {
    sysout.println("lambda (λ) was not detected with .equals.");
}

printHexOfString("Hex of λ", "λ");
printHexOfString("Hex of input", line);

}

private static void printHexOfString(String title, String str) {
StringBuilder stringBuilder = new StringBuilder();

char[] charArray = str.toCharArray();

for (char c : charArray) {
    String charToHex = Integer.toHexString(c);
    stringBuilder.append(charToHex);
}

System.out.println(title+ ": "+stringBuilder.toString());

}`

OP means that when he is using eclipse, the terminal of eclipse can recognize the input“ λ ".

When using vscode, we know that VScode using the CMD shell of windows, the Greek letters cannot be recognized (Greek letters are copied and pasted into the input box).

I tried different ISO charsets like 437 869 65001 936, but it didn't work.

Some of them can recognize "λ" as any other letter, but the other recognize "λ" as "".

Is there any way for the terminal used by vscode to recognize the input Greek letters?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Java snippet in the VS Code terminal using Windows CMD and the listed encodings, comparing pasted λ with Eclipse's terminal. Check whether the repository has a terminal or encoding entry point; the issue provides no file or test to target. Done means establishing a supported way to recognize the input or documenting that no repository change can provide it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
cli, developer-experience, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.