[Haskell-beginners] hGetContents, unicode and linux

Erik de Castro Lopo mle+hs at mega-nerd.com
Sun Nov 28 01:26:44 EST 2010


Hi all,

I've got a trivial test program:

    main :: IO ()
    main
     = do   text <- readFile "unicode.txt"
            putStr text

which I compile with ghc-6.12.1 (from Debian) and when it runs I get:

    hGetContents: invalid argument (Invalid or incomplete multibyte or wide character)

I've done some googling which seems to suggest that I need to set
the LANG environment variable, but I already have that set to
en_AU.UTF-8.

Clues?

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the Beginners mailing list