vscode-java-debug
vscode-java-debug copied to clipboard
VSCode Java UTF-8 does not print characters to the console
[provide a description of the issue]
Environment
- Operating System: Windows 10
- JDK version: 11
- Visual Studio Code version: 1.69.2
- Java extension version: Microsoft Java Pack v0.25.0
- Java Debugger extension version: latest
Steps To Reproduce
I have a problem with encoding Java System Output occurring only in Visual Studio Code. Like you can see in the image below bullet print as ? Eclipse and IntelliJ print the bullet point just fine. My program is very simple:
- [step 1]
[attach a sample project reproducing the error] attach logs
Current Result
I made sure chcp is UTF-8
Expected Result
Additional Informations
The chcp inside VSCode terminal is Active code page: 65001
This is a limitation of Windows terminal. If you manually run this Java command in terminal like ps and cmd, it cannot print the bullet Unicode character either.
You can try adding the setting "java.debug.settings.console." internalConsole"
, which will let the debugger print the program out using VS Code's built-in DEBUG CONSOLE. The DEBUG CONSOLE view can show the UTF_8 well.
This is strange on another computer I was able to run it perfectly I just had to change chcp to 65001
But as you can see from the images on my main computer I am already on chccp 65001 but still can not get it to work any idea why?
@itayasaf1990xd You could try to add a VS Code setting "java.debug.settings.vmArgs": "-Dfile.encoding=UTF-8"
, which will tell the debugger to use UTF-8
to run your app.