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
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
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
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
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
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
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
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
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