From a2dd80b97cf09e8e11c8c99e3bc876ef9f7628f7 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sat, 16 Feb 2008 09:04:21 +0100 Subject: PipeReader: add utf8 support darcs-hash:20080216080421-d6583-347341c11af83ddc1c543832c5d524c13d4abd32.gz --- Plugins/PipeReader.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/PipeReader.hs b/Plugins/PipeReader.hs index 695f1e6..6c84f71 100644 --- a/Plugins/PipeReader.hs +++ b/Plugins/PipeReader.hs @@ -3,7 +3,7 @@ -- Module : Plugins.PipeReader -- Copyright : (c) Andrea Rossato -- License : BSD-style (see LICENSE) --- +-- -- Maintainer : Andrea Rossato -- Stability : unstable -- Portability : unportable @@ -15,14 +15,15 @@ module Plugins.PipeReader where import System.IO +import qualified System.IO.UTF8 as U import Plugins data PipeReader = PipeReader String String deriving (Read, Show) -instance Exec PipeReader where +instance Exec PipeReader where alias (PipeReader _ a) = a start (PipeReader p _) cb = do h <- openFile p ReadMode - forever (hGetLine h >>= cb) + forever (U.hGetLine h >>= cb) where forever a = a >> forever a -- cgit v1.2.3