Ghc 6.12.1, System.Environment.getArgs and UTF-8

ghc 6.12 dropped individual utf8-string packages, since most of its functions are implemented in stock modules. In particular, System.Environment.UTF8 no longer exists.

But for me the following does not work if it argis a non-ascii string:

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

I get garbage on my terminal.

+3
source share
1 answer

This is a mistake, see

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

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

A workaround may be to install utf8-sting and use System.Environment.UTF8

+3
source

Source: https://habr.com/ru/post/1772626/


All Articles