
23 Aug
2010
23 Aug
'10
4:32 a.m.
2010/8/23 Luca Ciciriello
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.
Perhaps a missmatch between the file's encoding (utf8, iso-8859-1, etc) and your system's locale settings. David.