Skip to content

VSCode Java Debug Console in Terminal Not Showing Unicode Characters #524

@TheFanatr

Description

@TheFanatr

If the launch.json file for the project is changed to have the console property set to integratedTerminal for the launch configuration, any Unicode characters printed to said terminal with will be replaced with plain-text question marks. This is happening because the VSCode Terminal being started is using the default Windows code page of 65000, which is ASCII, not 65001 which is UTF-8.

Environment
  • Operating System: Windows 10 1809 Build 17763.253
  • JDK version: 10.0.2
  • Visual Studio Code version: 1.30.2
  • Java extension version: 0.5.0
  • Java Debugger extension version: 1.16.0
Steps To Reproduce
  1. Use command window (F1 key by default) to select Java: Create Java Project; use it to create a new project called JavaDebugConsoleIssue.
  2. Inside the main method generated in the App.java file of the app package, paste the following line.
System.out.println("\u26a1\u2661");
  1. Change the launch.json file within the .vscode folder to include a setting in the launch configuration like so: "console": "integratedTerminal".
  2. Run the project, and see that the symbols actually printed to the console are simply question marks in the place of where the characters are supposed to be.

Java Debug Console Issue Reproduction.zip
I don't think logs for this issue will really be helpful, because the problem is with something that is not done, not with something that is not working.

Current Result
PS C:\Users\alexf\Documents\Visual Studio Code\Workspaces\Java Debug Console Issue> cd 'c:\Users\alexf\Documents\Visual Studio Code\Workspaces\Java Debug Console Issue'; & 'C:\Program Files\Java\jdk-10.0.2\bin\java' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:62607' '-Dfile.encoding=UTF-8' '-cp' 'C:\Users\alexf\AppData\Roaming\Code\User\workspaceStorage\881c58722dff86f4979c37a374ece66d\redhat.java\jdt_ws\jdt.ls-java-project\bin' 'app.App'
??
Expected Result

⚡♡

Additional Information

Every other type of Terminal, including the integrated PowerShell Terminal that can be launched through the VSCode menus supports running equivalent code to generate proper Unicode character output. I cannot use the VSCode Debug Console, as it does not support input streams, which my project requires. Also, running the command chcp 65001 in the terminal after a run of the program will cause subsequent runs to display the proper characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions