[Haskell-beginners] hGetContents, unicode and linux
gale at sefer.org
Sun Nov 28 01:40:32 EST 2010
Erik de Castro Lopo wrote:
> 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
You can check to see what encoding GHC has picked up from your
environment by examining localeEncoding.
You can force the encoding to UTF-8 by
hSetEncoding stdin utf8
hSetEncoding stdout utf8
All of the above in the context of import System.IO, of course.
More information about the Beginners