-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbled characters occur when executing run
tasks from extensions with Java21.
#1480
Comments
The task can be executed correctly by setting the following in application {
mainClass = '...'
applicationDefaultJvmArgs = ['-Dstdout.encoding=UTF-8', '-Dstderr.encoding=UTF-8']
} However, if you run it in the terminal, you need to specify "terminal.integrated.profiles.windows": {
"JavaSE-21": {
"overrideName": true,
"env": {
"PATH": "D:\\xxx\\java\\21\\bin;${env:PATH}",
"JAVA_HOME": "D:\\xxx\\java\\21"
},
"path": "cmd",
"args": [
"/k",
"chcp",
"65001"
]
}
},
"terminal.integrated.defaultProfile.windows": "JavaSE-21",
"terminal.integrated.automationProfile.windows": {
"path": "cmd"
},
"java.test.config": {
"vmArgs": [
"-Dstdout.encoding=UTF-8",
"-Dstderr.encoding=UTF-8"
]
}, These settings can be automatically configured with the Extension Pack for Java Auto Config extension that I provide. |
Thanks for the advice. I'm aware that if I set Java and the terminals to UTF-8, the characters will not be garbled, and in fact I have avoiding the problem by doing so in my apps. I am focusing on the fact that the "Java outputs characters in UTF-8 and This is my uncertain guess, |
Extension Name: vscode-gradle
Extension Version: 3.13.5
OS Version: Windows11 23H2
VSCode version: 1.87.2
Java version: 21
Describe the bug
Garbled characters occur when executing
run
tasks from extensions with Java21.Gradle outputs in MS932 and the terminal tries to display in UTF-8.
To Reproduce
reproduction
tag commit of reproduction code repositoryExpected behavior
Gradle outputs in UTF-8 and the terminal tries to display in UTF-8.
Screenshots
. /gradlew run
in a terminal, no problem.Garbled characters occur when executing
run
tasks from extensions.The text was updated successfully, but these errors were encountered: