Re: How to work around GHC bug

2012-03-18 Thread Sergei Trofimovich
On Wed, 14 Mar 2012 14:51:59 +0100 Volker Wysk p...@volker-wysk.de wrote: 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

How to work around GHC bug

2012-03-14 Thread Volker Wysk
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

Re: How to work around GHC bug

2012-03-14 Thread Ozgur Akgun
Hi, On 14 March 2012 13:51, Volker Wysk p...@volker-wysk.de wrote: import System main = do [a] - getArgs putStrLn (show a) a here is already of type String. If you don't call show on it, it'll do the expected thing. Try: main = do [a] - getArgs putStrLn a HTH, Ozgur

Re: How to work around GHC bug

2012-03-14 Thread Christopher Done
On 14 March 2012 15:08, Ozgur Akgun ozgurak...@gmail.com wrote: On 14 March 2012 13:51, Volker Wysk p...@volker-wysk.de wrote: import System main = do [a] - getArgs putStrLn (show a) a here is already of type String. If you don't call show on it, it'll do the expected thing. He

Re: How to work around GHC bug

2012-03-14 Thread Volker Wysk
Am Mittwoch 14 März 2012, 15:08:38 schrieben Sie: On 14 March 2012 13:51, Volker Wysk p...@volker-wysk.de wrote: import System main = do [a] - getArgs putStrLn (show a) a here is already of type String. If you don't call show on it, it'll do the expected thing. Try: main

Re: How to work around GHC bug

2012-03-14 Thread Ozgur Akgun
Hi again, On 14 March 2012 14:17, Volker Wysk p...@volker-wysk.de wrote: That's not true. The result is: ./tmp $ ./arg ä ä This prints out ä on my machine. However, I see the point about length ä not being 1, so I am not claiming that there is no problem. Good luck, Ozgur

Re: How to work around GHC bug

2012-03-14 Thread Donn Cave
Quoth Volker Wysk p...@volker-wysk.de, ... 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? Data.Text might work

Re: How to work around GHC bug

2012-03-14 Thread Volker Wysk
Am Mittwoch 14 März 2012, 16:04:25 schrieben Sie: I have $LANG = en_GB.UTF-8 and I am on mac os x, if that helps. Now we have the riddle, of why it works differently on your machine. However, e can leave it at that, I think. Happy hacking, Volker

Re: How to work around GHC bug

2012-03-14 Thread Volker Wysk
Am Mittwoch 14 März 2012, 16:19:33 schrieben Sie: Quoth Volker Wysk p...@volker-wysk.de, 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