Re: another unicode bug

Malcolm Wallace <[email protected]> Thu, 30 Sep 2004 12:05:56 +0100
Newsgroups gmane.comp.lang.haskell.nhc.bugs
Organization Dept of Computer Science, University of York
Message-ID <[email protected]>
Antonio Regidor Garc=EDa <[email protected]> writes:

> I can't compile this function
>=20
> change :: Char -> Char
> change 'a' =3D 'b'
> change x =3D x
>=20
> 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