handling of multibyte char strings

Jens Petersen petersen@redhat.com
14 Apr 2002 01:57:31 +0900


GHC 5.02.[23] seems to be quite strict about literal strings
in source code.  I presume this is a feature. :-)  However
this is annoying for people who want to use wide chars in
strings in source code.  (Though I realise that doing so is
not very "portable".)

To illustrate, the following program

main :: IO ()
main =
    let ja = 'Japanese character' in putChar ja >> putChar '\n'

results in

Compiling Main             ( test-ja.hs, interpreted )
test-ja.hs:3: error in character literal
Failed, modules loaded: none.

with both ghc and ghci.

Is anything allowed in literal strings except ascii?  utf-8?

Jens