Skip to content

Format ExitCodeException stdout and stderr with UTF-8 #87

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

Merged
merged 2 commits into from
Apr 12, 2025

Conversation

tomjaguarpaw
Copy link
Collaborator

Closes #86

Before:

ghci> readProcess_ (shell "echo привет;echo 😑 1>&2 ; exit 1")
*** Exception: Received ExitFailure 1 when running
Shell command: echo привет;echo 😑 1>&2 ; exit 1
Standard output:

пÑивеÑ
Standard error:

ð

After:

ghci> readProcess_ (shell "echo привет;echo 😑 1>&2 ; exit 1")
*** Exception: Received ExitFailure 1 when running
Shell command: echo привет;echo 😑 1>&2 ; exit 1
Standard output:

привет
Standard error:

😑

@9999years
Copy link
Contributor

I think this looks OK. It should probably include the test-cases I wrote for this behavior in #88 and #89 though?

Closes fpco#86

Thanks to @9999years for the legwork on this change
@tomjaguarpaw tomjaguarpaw merged commit 90332ce into fpco:master Apr 12, 2025
23 checks passed
@tomjaguarpaw
Copy link
Collaborator Author

Thanks. Let's add unit tests if we need them when incorporating your whitespace changes.

@tomjaguarpaw tomjaguarpaw deleted the utf-8 branch April 12, 2025 12:24
@tomjaguarpaw
Copy link
Collaborator Author

Published as https://hackage.haskell.org/package/typed-process-0.2.13.0

Thanks @9999years for this contribution, and thanks to @lf- for contributing to the discussion.

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

Successfully merging this pull request may close these issues.

readProcess_ garbles non-ASCII output on failure
2 participants