mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
fastcgi server: decode UTF-8 inputs produced by the gwt client
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user