
30 Sep
2004
30 Sep
'04
11:05 a.m.
Antonio Regidor GarcĂa
I can't compile this function
change :: Char -> Char change 'a' = 'b' change x = x
if I replace 'b' with a non-ascii character. The compiler complaints "Character literal with length>1".
The Haskell'98 Report says: Haskell uses the Unicode [11] character set. However, source programs are currently biased toward the ASCII character set used in earlier versions of Haskell. I'm afraid it is still true that all the compiler implementations accept only 8-bit characters in source files. You can notate a larger character with a hex escape e.g. '\x10d5', but often this is truncated to the lower 8-bits on output. The use of Unicode in Haskell remains a hope, not a reality. Regards, Malcolm