On Wed, 14 Mar 2012 14:51:59 +0100
Volker Wysk 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 (show a)
>
Am Mittwoch 14 März 2012, 16:19:33 schrieben Sie:
> Quoth Volker Wysk ,
> > 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
> > Un
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
__
Quoth Volker Wysk ,
...
> 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 for you. I'm not g
Hi again,
On 14 March 2012 14:17, Volker Wysk 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
Am Mittwoch 14 März 2012, 15:08:38 schrieben Sie:
> On 14 March 2012 13:51, Volker Wysk 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:
> mai
On 14 March 2012 15:08, Ozgur Akgun wrote:
> On 14 March 2012 13:51, Volker Wysk 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 means that the UTF-8
Hi,
On 14 March 2012 13:51, Volker Wysk 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
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 pr