Skip to content

Pass streamCharset to the stdout and stderr pumpers - #432

Merged
slachiewicz merged 1 commit into
masterfrom
agent/callable-stream-charset
Sep 11, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/callable-stream-charset

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

executeCommandLineAsCallable has taken a Charset since 3.3.x but never passed it to the two StreamPumper instances, so process output was always decoded with the JVM default charset. The synchronous executeCommandLine overload with a charset delegates here, so the parameter was dead in both. This wires it through; StreamPumper already had the constructor.

The test runs printf through the shell to emit the UTF-8 bytes of "café" and decodes them once as UTF-8 and once as ISO-8859-1, so it holds whatever the platform default is. It is Unix-only like the neighbouring large-stdout test.

Fixes #302. PR #60 was closed by the JIRA import, not by a fix.

Verified: mvn -B verify on JDK 17 -> Tests run: 792, Failures: 0, Errors: 0; the new test fails on master with expected: <café> but was: <café>.

This change was created with AI assistance.

executeCommandLineAsCallable accepted a Charset since 3.3.x but never
handed it to StreamPumper, so process output was always decoded with the
JVM default charset. The synchronous executeCommandLine overload with a
charset delegates here, so it was dead in both.

Fixes #302
@slachiewicz slachiewicz added this to the 3.5.0 milestone Sep 11, 2026
@slachiewicz slachiewicz added the bug Something isn't working label Sep 11, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 11, 2026 07:58
@slachiewicz
slachiewicz requested a review from elharo September 11, 2026 07:58
@slachiewicz
slachiewicz merged commit 99c724c into master Sep 11, 2026
15 checks passed
@slachiewicz
slachiewicz deleted the agent/callable-stream-charset branch September 11, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MSHARED-938] CommandLineUtils#executeCommandLineAsCallable causes encoding issue(chinese)

2 participants