diff --git a/Network/XmlRpc/Server.hs b/Network/XmlRpc/Server.hs
--- a/Network/XmlRpc/Server.hs
+++ b/Network/XmlRpc/Server.hs
@@ -33,6 +33,8 @@
 import Data.Maybe
 import Control.Monad.Error
 import Control.Exception
+import qualified Codec.Binary.UTF8.String as U
+import System.IO
 
 serverName = "Haskell XmlRpcServer/0.1"
 
@@ -159,8 +161,10 @@
 cgiXmlRpcServer :: [(String,XmlRpcMethod)] -> IO ()
 cgiXmlRpcServer ms = 
     do
-    input <- getContents
-    output <- server ms input
+    hSetBinaryMode stdin True
+    hSetBinaryMode stdout True
+    input <- U.decodeString `fmap` getContents
+    output <- U.encodeString `fmap` server ms input
     putStr ("Server: " ++ serverName ++ crlf)
     putStr ("Content-Type: text/xml" ++ crlf)
     putStr ("Content-Length: " ++ show (length output) ++ crlf)
diff --git a/haxr.cabal b/haxr.cabal
--- a/haxr.cabal
+++ b/haxr.cabal
@@ -1,5 +1,5 @@
 Name: haxr
-Version: 3000.6
+Version: 3000.7
 Cabal-version: >=1.6
 Build-type: Simple
 Copyright: Bjorn Bringert, 2003-2006
