Some of the standard Haskell libraries behave slightly differently on Windows.
On Windows, the '^Z' character is interpreted as an
end-of-file character, so if you read a file containing this character
the file will appear to end just before it. To avoid this,
use IOExts.openFileEx to open a file in binary
(untranslated) mode or change an already opened file handle into
binary mode using IOExts.hSetBinaryMode. The
IOExts module is part of the
lang package.