How to work around GHC bug

Volker Wysk pf3 at volker-wysk.de
Wed Mar 14 14:51:59 CET 2012


Hi!

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

arg.hs------------------------------

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

--------------------------------------

When called like this:

   ./arg ä

The program will output this:

   "\195\164"

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?

Bye
Volker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20120314/1b70d0d0/attachment.htm>


More information about the Glasgow-haskell-users mailing list