redhat-developer / redhat-developer/vscode-java
Is there any way for the terminal used by vscode to recognize the input Greek letters
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 2.3k
- Forks
- 546
- Merge moyen
- 20 h 1 min
- PR mergées (30 j)
- 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?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire l’extrait Java dans le terminal de VS Code avec Windows CMD et les encodages indiqués, en comparant λ collé avec le terminal d’Eclipse. Vérifiez si le dépôt possède un point d’entrée pour le terminal ou l’encodage ; l’issue ne fournit ni fichier ni test à cibler. Le travail est terminé lorsqu’une méthode prise en charge pour reconnaître l’entrée est établie, ou lorsqu’il est documenté qu’aucune modification du dépôt ne peut la fournir.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java, vscode
- Domaine
- cli, developer-experience, operating-systems
- Type d'issue
- Bug
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 20/100