on master help sign in
Merge pull request #1334 from Melvar/fix-ipc-enc

Set the handles used for --client to use UTF-8

commitf60626f5504c711da851f19f21f0e1069fb750df authorEdwin Brady <edwin.brady@gmail.com> dateTue 1 Jul 2014, 11:40 (12 years ago) parentfc947a65bfe037
1 file changed+2
src/Idris/REPL.hs+2
src/Idris/REPL.hs+2
@@ -151,6 +151,7 @@ startServer orig fn_in = do tid <- runIO $ forkOS serverLoop
151151
152152 loop fn ist sock
153153 = do (h,_,_) <- accept sock
154+ hSetEncoding h utf8
154155 cmd <- hGetLine h
155156 (ist', fn) <- processNetCmd orig ist h fn cmd
156157 hClose h
@@ -189,6 +190,7 @@ processNetCmd orig i h fn cmd
189190runClient :: String -> IO ()
190191runClient str = withSocketsDo $ do
191192 h <- connectTo "localhost" (PortNumber 4294)
193+ hSetEncoding h utf8
192194 hPutStrLn h str
193195 resp <- hGetResp "" h
194196 putStr resp