fastcgi server: decode UTF-8 inputs produced by the gwt client

This commit is contained in:
bjorn
2008-09-15 15:20:15 +00:00
parent 1579174e14
commit a43ed0f99f

View File

@@ -7,7 +7,7 @@ import URLEncoding
import Network.CGI import Network.CGI
import Text.JSON import Text.JSON
import qualified Codec.Binary.UTF8.String as UTF8 (encodeString) import qualified Codec.Binary.UTF8.String as UTF8 (encodeString, decodeString)
import Control.Monad import Control.Monad
import Data.Char import Data.Char
@@ -42,7 +42,7 @@ cgiMain pgf =
outputJSON json outputJSON json
where where
getText :: CGI String getText :: CGI String
getText = liftM (maybe "" urlDecodeUnicode) $ getInput "input" getText = liftM (maybe "" (urlDecodeUnicode . UTF8.decodeString)) $ getInput "input"
getTree :: CGI PGF.Tree getTree :: CGI PGF.Tree
getTree = do mt <- getInput "tree" getTree = do mt <- getInput "tree"