Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Non-ASCII char support for Windows terminals #622

Copy link
Copy link

Description

@Eskibear
Issue body actions

When launching in integrated/external terminal, the debugger passes commands to vscode, and vscode assembles and sends it to the terminal. But if there's non-ascii char in code/path, the java process will have unexpected behavior, because of bad Unicode support in Windows.

Either VS Code or the extension should do something to cover these cases.

Example

Folder structure:

中文目录
├── Hello.class
└── Hello.java
0 directories, 2 files

Content of file 中文目录/Hello.java:

public class Hello {
  public static void main(String[] args) {
    System.out.println("中文");
  }
}

a) on Mac OSX

Works as expected

$> java -cp 中文目录 Hello
中文

b) on Windows

Non-ASCII char in classpath

Classpath is not correctly recognized by Java, if it contains non-ascii char.

D:\Test>java -cp 中文目录 Hello
Error: Could not find or load main class Hello

Non-ASCII char in stdout

cd into the folder, the classpath is correctly recognized now, but the terminal fails to print non-ascii chars.

D:\Test>cd 中文目录

D:\Test\中文目录>java -cp . Hello
ä??æ??

To display non-ascii char in Windows terminals, you have to modify the code page, see https://ss64.com/nt/chcp.html

Workaround: set code page to 65001 (utf-8)

D:\Test\中文目录>chcp 65001
Active code page: 65001

D:\Test\中文目录>java -cp . Hello
中文
Reactions are currently unavailable

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.