Skip to content
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

The CJK(Chinese/Japanese/Korean) characters in stderr are displayed as "?" after mvnd 1.0-m6-39 in Windows #885

Open
GitPopcorn opened this issue Sep 15, 2023 · 1 comment

Comments

@GitPopcorn
Copy link

GitPopcorn commented Sep 15, 2023

Probably related issue: #883

Things like:

  • Correct display:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project tfpay-notify-api: Compilation failure
[ERROR] /E:/workspace-test/maven-group/maven-cjk-char-display-error-demo/src/main/java/org/apache/maven/daemon/test/TestType.java:[17,66] 找不到符号
[ERROR]   符号:   类 TestParam123
[ERROR]   位置: 接口 org.apache.maven.daemon.test.TestType
  • Wrong display:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project tfpay-notify-api: Compilation failure
[ERROR] /E:/workspace-test/maven-group/maven-cjk-char-display-error-demo/src/main/java/org/apache/maven/daemon/test/TestType.java:[17,66] ?????
[ERROR]   ??:   ? TestParam123
[ERROR]   ??: ?? org.apache.maven.daemon.test.TestType

The command line tools seems dose not affect to this, I have test with CMD/PowerShell/Git Bash/Node.JS process API. The output from Maven Daemon is just "?" and can not be decoded correctly anyway.

The wrong decoding result "?" usually comes from encode with UTF-8 -> decode with GBK -> encode with UTF-8 -> decode with GBK.

At first I think the changes of Maven 4.0.0-alpha caused this, but then I test it with several different Mvn Daemon/JDK/Character Page and finally found that it is only related to the version of Maven Daemon:

  • Maven Daemon 0.9.0 (Maven 3.8.7) + CHCP 936 (GBK) + JDK 1.8.0 : Correct
  • Maven Daemon 0.9.0 (Maven 3.8.7) + CHCP 936 (GBK) + JDK 19 : Correct
  • Maven Daemon 0.9.0 (Maven 3.8.7) + CHCP 65001 (UTF-8) + JDK 1.8.0 : Correct
  • Maven Daemon 0.9.0 (Maven 3.8.7) + CHCP 65001 (UTF-8) + JDK 19 : Correct
  • Maven Daemon 1.0.0-m4 (Maven 4.0.0-alpha-4) + CHCP 936 (GBK) + JDK 1.8.0 : Correct
  • Maven Daemon 1.0.0-m4 (Maven 4.0.0-alpha-4) + CHCP 936 (GBK) + JDK 19 : Correct
  • Maven Daemon 1.0.0-m4 (Maven 4.0.0-alpha-4) + CHCP 65001 (UTF-8) + JDK 1.8.0 : Correct
  • Maven Daemon 1.0.0-m4 (Maven 4.0.0-alpha-4) + CHCP 65001 (UTF-8) + JDK 19 : Correct
  • Maven Daemon 1.0-m6-39 (Maven 3.9.1) + CHCP 936 (GBK) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m6-39 (Maven 3.9.1) + CHCP 936 (GBK) + JDK 19 : Wrong
  • Maven Daemon 1.0-m6-39 (Maven 3.9.1) + CHCP 65001 (UTF-8) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m6-39 (Maven 3.9.1) + CHCP 65001 (UTF-8) + JDK 19 : Wrong
  • Maven Daemon 1.0-m6-40 (Maven 4.0.0-alpha-5) + CHCP 936 (GBK) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m6-40 (Maven 4.0.0-alpha-5) + CHCP 936 (GBK) + JDK 19 : Wrong
  • Maven Daemon 1.0-m6-40 (Maven 4.0.0-alpha-5) + CHCP 65001 (UTF-8) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m6-40 (Maven 4.0.0-alpha-5) + CHCP 65001 (UTF-8) + JDK 19 : Wrong
  • Maven Daemon 1.0-m7-39 (Maven 3.9.3) + CHCP 936 (GBK) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m7-39 (Maven 3.9.3) + CHCP 936 (GBK) + JDK 19 : Wrong
  • Maven Daemon 1.0-m7-39 (Maven 3.9.3) + CHCP 65001 (UTF-8) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m7-39 (Maven 3.9.3) + CHCP 65001 (UTF-8) + JDK 19 : Wrong
  • Maven Daemon 1.0-m7-40 (Maven 4.0.0-alpha-7) + CHCP 936 (GBK) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m7-40 (Maven 4.0.0-alpha-7) + CHCP 936 (GBK) + JDK 19 : Wrong
  • Maven Daemon 1.0-m7-40 (Maven 4.0.0-alpha-7) + CHCP 65001 (UTF-8) + JDK 1.8.0 : Wrong
  • Maven Daemon 1.0-m7-40 (Maven 4.0.0-alpha-7) + CHCP 65001 (UTF-8) + JDK 19 : Wrong

In fact I don't know how to stably print CJK characters in a english command-line environment, so I'm sorry I cannot provide a smallest demo to reproduce this issue, because those CJK characters are all from the compilation error message. But I'm pretty sure there was something changed from 1.0-m6 version to cause this issue.

@GitPopcorn GitPopcorn changed the title The CJK characters in stderr are displayed as "?" after mvnd 1.0-m6-39 in Windows The CJK(Chinese/Japanese/Korean) characters in stderr are displayed as "?" after mvnd 1.0-m6-39 in Windows Sep 15, 2023
@u2bo
Copy link

u2bo commented Feb 20, 2024

have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants