[nhc-bugs] another unicode bug

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Thu Sep 30 07:05:56 EDT 2004


Antonio Regidor García <a_regidor at yahoo.es> writes:

> 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


More information about the Nhc-bugs mailing list