[Haskell-cafe] Unicode strings and runCommand / runProcess

John Goerzen jgoerzen at complete.org
Fri Apr 23 13:44:29 EDT 2010

Here is a very interesting little problem.

GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :m System.Process
Prelude System.Process> runCommand "echo привет"

This is a minimal test case for a bug reported in HSH at 

It is not entirely clear to me what the behavior here should be.  It 
seems inconsistent with the default behavior of System.IO to, 
apparently, just strip the bits higher than 0xFF.  On the other hand, 
when it's OS commands we're talking about, it's not entirely clear to me 
if the default should be to encode in UTF-8.  There should almost 
certainly be an *option* controlling this, and perhaps a version of 
runProcess that accepts ByteStrings.


-- John

More information about the Haskell-Cafe mailing list