summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Main.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Main.hs b/app/Main.hs
index ae8bece..6a416be 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -13,7 +13,7 @@ module Main (main) where
import XMLParse -- Our slightly modified copy of Text.XML.HaXml.Parse
-import System.IO (hFlush, stdout)
+import System.IO (stdin, stdout, hSetEncoding, utf8, hFlush)
import Text.XML.HaXml.Lex (xmlLex)
import Text.XML.HaXml.Posn (Posn ())
import Text.ParserCombinators.Poly.State (stGet)
@@ -47,7 +47,10 @@ bslOut :: [BSL.ByteString] -> IO ()
bslOut = mapM_ $ (*> hFlush stdout) . BSL8.putStrLn
main :: IO ()
-main = bslOut . plugin =<< rpcIn
+main = do
+ hSetEncoding stdin utf8
+ hSetEncoding stdout utf8
+ bslOut . plugin =<< rpcIn
plugin :: [Document Posn] -> [BSL.ByteString]
plugin [] = []