[Haskell-cafe] Has character changed in GHC 6.8?

Jules Bean jules at jellybean.co.uk
Tue Jan 22 11:56:22 EST 2008

Magnus Therning wrote:
> Yes, of course, stupid me.  But it is still the UTF-8 representation of 
> "ö", not Latin-1, and this brings me back to my original question, is 
> this an intentional change in 6.8?
>  > map ord "ö"
> [246]
>  > map ord "åɓz𝐀"
> [229,595,65370,119808]
> 6.8 produces Unicode code points rather then a particular encoding.

The key point here is this has nothing to do with GHC.

GHC's behaviour has not changed in this regard.

This is about GHCi! [And, to some extent, the behaviour of whatever 
shell / terminal emulator you run ghci in]

Sounds like a pedantic difference, but it's not.

The difference here is what GHCi is feeding into your haskell code when 
you type the sequence "ö" at a ghci prompt, rather than anything 
different about the underlying behaviour of map, ord, length, show, 
putStr. map, ord, length, show, putStr have not changed from 6.6 to 6.8.

I don't have 6.8 handy myself but from your demonstration is would 
appear that 6.8's ghci correctly understands whatever input encoding is 
being used in whatever terminal environment you are choosing to run ghci 

Whereas, 6.6's ghci was using a single-byte terminal approach, and your 
terminal environment was encoding ö as two characters.


More information about the Haskell-Cafe mailing list