How to work around GHC bug

Volker Wysk pf3 at
Wed Mar 14 14:51:59 CET 2012


The following program demonstrates a (another) GHC bug. The command line isn't 
properly decoded to Unicode.


import System
main = do
   [a] <- getArgs
   putStrLn (show a)


When called like this:

   ./arg ä

The program will output this:


I'll report this as a bug in the GHC Trac. But for now, I need to work around 
the problem somehow. The encoders in GHC.IO.Encoding all work on buffers. How 
do I recode the command line, in order to get proper Unicode strings?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Glasgow-haskell-users mailing list