Question

ghc 6.12 dropped separate utf8-string packages since most of its functionality is implemented in stock modules. In particular System.Environment.UTF8 does not exist anymore.

But the following does not work for me if an arg is a non-ascii string:

import System.Environment
main = do
  [arg] <- getArgs
  putStrLn arg

I get some garbage at my terminal.

Was it helpful?

Solution

It is a bug, see

http://hackage.haskell.org/trac/ghc/ticket/3309

(I assume you mean System.Environment, not System.Environment.UTF8)

The workaround could be to cabal install utf8-sting and use System.Environment.UTF8

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top