-
Notifications
You must be signed in to change notification settings - Fork 25
readProcess_ garbles non-ASCII output on failure #86
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
Comments
tomjaguarpaw
added a commit
to tomjaguarpaw/typed-process
that referenced
this issue
Apr 8, 2025
tomjaguarpaw
added a commit
to tomjaguarpaw/typed-process
that referenced
this issue
Apr 8, 2025
tomjaguarpaw
added a commit
to tomjaguarpaw/typed-process
that referenced
this issue
Apr 8, 2025
9999years
added a commit
to 9999years/typed-process
that referenced
this issue
Apr 8, 2025
Partial fix for fpco#86. This isn't perfect (for retrocomputing you may want another character encoding) but improves the behavior in many circumstances.
9999years
added a commit
to 9999years/typed-process
that referenced
this issue
Apr 8, 2025
Partial fix for fpco#86. This isn't perfect (for retrocomputing you may want another character encoding) but improves the behavior in many circumstances.
9999years
added a commit
to 9999years/typed-process
that referenced
this issue
Apr 8, 2025
Partial fix for fpco#86. This isn't perfect (for retrocomputing you may want another character encoding) but improves the behavior in many circumstances.
tomjaguarpaw
added a commit
to tomjaguarpaw/typed-process
that referenced
this issue
Apr 8, 2025
Closes fpco#86 Thanks to @9999years for the legwork on this change
tomjaguarpaw
added a commit
to tomjaguarpaw/typed-process
that referenced
this issue
Apr 12, 2025
Closes fpco#86 Thanks to @9999years for the legwork on this change
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First consider
runProcess_
, which behaves well. It inherits stdin and stdout and therefore avoids interfering in any encoding decisions. As long as the subprocess output encoding matches the terminal encoding all is good:But
readProcess_
does not behave well. On failure, it puts stdin and stdout into anExitCodeException
. When it comes to callshow
ordisplayException
it must choose an encoding to use, but it does not know which it should choose! Currently it usesdecode :: ByteString -> String
, which is probably the worst of all worlds:The output is completely garbled, and this is really bad for anyone working with non-ASCII.
Thanks to @9999years for bringing this to my attention in #83 (comment).
The text was updated successfully, but these errors were encountered: