I have this simple code that should print these characters
public class App {
public static void main(String[] args) throws Exception {
System.out.print("名 é à è €");
}
}
But whenever I run and debug in VS Code my project, the output in the terminal is this:
I tried to enter chcp 65001
to fix it but it does not correct the isssue and here's the output after:
I tried to do these things outside of VS Code by doing javac and java and this is what I got:
Without chcp 65001
:
With chcp 65001
:
Here's my javac version: javac 22.0.1
this issue could be the cause of the coding error. By default, vscode uses UTF-8 encoding, and the computer uses GBK. I tried changing the computer settings to work fine: