apache / apache/maven-mvnd

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

Open
#885 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.5k
Forks
250
Avg merge
16h 22m
Merged PRs (30d)
36

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with related issue #883 and reproduce the regression on Windows using Maven Daemon 1.0-m6-39 versus 1.0-m4, with CJK compiler diagnostics and the listed CHCP and JDK combinations. Investigate the Maven Daemon command-line output path; done means Chinese, Japanese, and Korean characters remain readable instead of becoming question marks.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.