[Haskell-cafe] gbp sign showing as unknown character by GHC

Stuart Cook scook0 at gmail.com
Thu Aug 20 03:32:01 EDT 2009

On Thu, Aug 20, 2009 at 5:12 PM, Colin Paul
Adams<colin at colina.demon.co.uk> wrote:
> Yes, but surely this will work both ways. The same bytes on input
> should come back on output, shouldn't they?

I would have thought so, but apparently this isn't actually what happens.

    GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
    Loading package base ... linking ... done.
    Prelude> map Data.Char.ord "饁"
    [39233]    <== 0x9941
    Prelude> putStrLn "饁"
    A     <== 0x41

It seems that GHCi is clever enough to decode UTF-8 input, which only
serves to confuse System.IO even more.


More information about the Haskell-Cafe mailing list