redhat-developer / redhat-developer/vscode-java

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

Aperta
#2,457 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

caused-by-extension question
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo lo snippet Java nel terminale di VS Code usando Windows CMD e le codifiche elencate, confrontando λ incollato con il terminale di Eclipse. Verifica se il repository dispone di un punto di ingresso per il terminale o la codifica; l’issue non indica alcun file o test come obiettivo. Il lavoro è completato quando viene stabilito un modo supportato per riconoscere l’input oppure viene documentato che nessuna modifica al repository può fornirlo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, vscode
Ambito
cli, developer-experience, operating-systems
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.