redhat-developer / redhat-developer/vscode-java
Is there any way for the terminal used by vscode to recognize the input Greek letters
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
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?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Java-Snippet im VS Code-Terminal mit Windows CMD und den aufgeführten Encodings zu reproduzieren, und vergleiche dabei eingefügtes λ mit dem Terminal von Eclipse. Prüfe, ob das Repository einen Terminal- oder Encoding-Einstiegspunkt hat; das Issue gibt keine Datei und keinen Test als Ziel vor. Als erledigt gilt, einen unterstützten Weg zur Erkennung der Eingabe festzustellen oder zu dokumentieren, dass keine Änderung am Repository dies ermöglichen kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, vscode
- Bereich
- cli, developer-experience, operating-systems
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100