Commit 5d6b3bc5 authored by Simon Marlow's avatar Simon Marlow

Unbreak these programs after Unicode IO support was added

Set binary mode on Handles appropriately.
parent 3a2f4aca
...@@ -16,10 +16,13 @@ module Main (main) where ...@@ -16,10 +16,13 @@ module Main (main) where
import Defaults import Defaults
import BinConv -- binary conversion routines import BinConv -- binary conversion routines
import Encode -- coding routine import Encode -- coding routine
import System.IO
main = do
main = getContents >>= \ inp -> hSetBinaryMode stdin True
putStr (compress inp) hSetBinaryMode stdout True
inp <- getContents
putStr (compress inp)
{- To compress a string we first encode it, then convert it to n-bit binaries {- To compress a string we first encode it, then convert it to n-bit binaries
- convert back to decimal as ascii-bit values and then to characters - convert back to decimal as ascii-bit values and then to characters
......
...@@ -7,9 +7,13 @@ where ...@@ -7,9 +7,13 @@ where
import Encode import Encode
import WriteRoutines import WriteRoutines
import System.IO
main = getContents >>= \ i -> main = do
putStr (compress i) hSetBinaryMode stdin True
hSetBinaryMode stdout True
i <- getContents
putStr (compress i)
-- The output is given by a magic header consisting of two fixed numbers, -- The output is given by a magic header consisting of two fixed numbers,
-- and a third representing the maximum number of bits used per code and -- and a third representing the maximum number of bits used per code and
......
...@@ -32,6 +32,7 @@ import Matrix ...@@ -32,6 +32,7 @@ import Matrix
import Patchlevel import Patchlevel
import System import System
import System.IO
main = do main = do
argv <- getArgs argv <- getArgs
...@@ -39,6 +40,7 @@ main = do ...@@ -39,6 +40,7 @@ main = do
n = case argv of n = case argv of
[a] -> read a [a] -> read a
_ -> 7 _ -> 7
hSetBinaryMode stdout True
putStr (picture n) putStr (picture n)
picture n = go n pic picture n = go n pic
......
...@@ -36,11 +36,14 @@ import Tags ...@@ -36,11 +36,14 @@ import Tags
import Parse import Parse
import System.IO
--proof_edit : string list * string list -> unit --proof_edit : string list * string list -> unit
main = do main = do
hSetBinaryMode stdin True
hSetBinaryMode stdout True
ins <- getContents ins <- getContents
putStr (main' ins) putStr (main' ins)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment