[Haskell-beginners] hGetContents

Luca Ciciriello luca_ciciriello at hotmail.com
Mon Aug 23 04:26:06 EDT 2010

I all.


I'm reading a txt file using the code 


inh <- openFile "myfile.txt" ReadMode

contents <- hGetContents inh


On Windows all works fine. I'm able to read the file without any problems.

On Mac OS X (10.6.4), with the same txt file and the same code above, I get the exception:


hGetContents: invalid argument (Illegal byte sequence).


In both the systems (Mac and Windows) I've installed the same Haskell platform 2010.2.0.0 (GHC 6.12.3).


Any idea why I've this behaviour on Mac system?


Thanks in advance for any answer.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100823/0d396304/attachment.html

More information about the Beginners mailing list