redhat-developer / redhat-developer/vscode-java

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

Abierto
#2,457 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

caused-by-extension question
Lenguaje dominante
TypeScript
Estrellas
2.3k
Forks
546
Merge medio
20 h 1 min
PR fusionados (30 d)
11

Descripción

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?

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza reproduciendo el fragmento de Java en el terminal de VS Code mediante Windows CMD y las codificaciones indicadas, comparando λ pegado con el terminal de Eclipse. Comprueba si el repositorio tiene un punto de entrada para terminal o codificación; el issue no proporciona ningún archivo ni prueba como objetivo. Se considera terminado establecer una forma compatible de reconocer la entrada o documentar que ningún cambio en el repositorio puede proporcionarla.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java, vscode
Área
cli, developer-experience, operating-systems
Tipo de issue
Error
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.