readFile problems
Hello,
We are two students from the University of Utrecht (the
Netherlands) working on a project in Haskell. During
work on the project, we encountered a problem with
the 'readFile' IO Monad. readFile stops reading a file
when it encounters ASCII character 26 (\SUB or \^Z - the
escape character), as the following piece of coding
shows. We've tested this with both the Hugs interpreter
and the GHC compiler, but both encounter the same
problem. Are there any known solutions for this?
Regards,
Richard Nieuwenhuis and Niels Reyngoud
rnieuwen@students.cs.uu.nl, nreijngo@students.cs.uu.nl
------------
module Main where
main = do let output = problemtext
putStr output
putStr "\n\n"
writeFile "outputfile.txt" output
text <- readFile "outputfile.txt"
putStr text
problemtext :: String
problemtext = "strange\SUBstrange"
Trac metadata
Trac field | Value |
---|---|
Version | None |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | ResolvedNoReason |
Component | None |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |