开发者

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

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 termina开发者_StackOverflow中文版l.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜