hGetContents bug?

Andre W B Furtado awfurtado@uol.com.br
Thu, 11 Oct 2001 02:41:38 -0300


If I open a file using "openFile" from the IO module

(x <- openFile "foo.txt" ReadMode)

and convert it to a String via hGetContents

(y <- hGetContents x)

and finally try to print the file on the screen

(putStrLn y)

I'll get a strange result if the file contains the character 1A-hexadecimal
(or 26-decimal): all characters beyond this point won't be printed on the
screen.

If I use openFileEx (from IOExts module) rather than openFile, some
characters will be printed after the 1A/26, but not all of them.

I know this special character is related to EOF or something like that in
Windows platforms, but is this the expected behavior of function
hGetContents?

(please reply to both the list AND me)
Thanks,
-- Andre Furtado