To show or not to show french accents

Simon Marlow simonmar at microsoft.com
Tue Dec 16 15:37:04 EST 2003


 
> The following haskell program :
> 
> --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> module Main where
> 
> accentLetters :: String
> accentLetters = "éàô"
> 
> main :: IO ()
> main = do putStr (show accentLetters)
> -->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> 
> after being compiled will give the result :
> 
> "\233\224\244"
> 
> But, exactly the same program, without the "show" function 
> will give the result:
> 
> éàô
> 
> Is there some way to have "show" show all the printable 
> characters, even those
> represented by a value greater than the US-ASCII 7 bits (127) ?

This is the correct result, according to the Haskell 98 report (see the definition of Char.showLitChar).  However, arguably the Haskell 98 behaviour is wrong, since there are lots of printable Unicode characters >127.  We don't propose to do anything here.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list