on master help sign in
Set the handles used for --client to use UTF-8

Previously they were binary-mode, so they used char8 “encoding”, taking codepoint values modulo 256, leading to cryptic identifier mangling errors when using idris-vim.

commit5bfe0374f59521c2e4aee22e3eabe92dd44c75df authorMelvar Chen <Melvar.Chen@googlemail.com> dateThu 26 Jun 2014, 16:20 (12 years ago) parent853a634
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