Skip to content

System.Process doesn't encode its arguments.

System.Process doesn't encode strings while creating new processes. It truncate them instead. Here is simple test case. testUnicode should always return True but does so only for ASCII string.

testUnicode :: String -> IO Bool
testUnicode str = ((== str) . init) `fmap` (readProcess "echo" [str] "")

In GHCi I get following:

*Main> testUnicode "It works here"
True
*Main> testUnicode "А здесь сломалось"
False

I think this bug isn't controversial like #3307 (closed) and #3309 (closed) since there is no possible information loss.

Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/process
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information