mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
example-based: bug fix: apply UTF-8 decoding to CGI inputs
You can now use words with ÅÄÖ when writing Swedish grammars by example...
This commit is contained in:
@@ -4,6 +4,7 @@ import System.FilePath((</>),makeRelative)
|
|||||||
import Data.Map(fromList)
|
import Data.Map(fromList)
|
||||||
import Data.Char(isDigit)
|
import Data.Char(isDigit)
|
||||||
import Data.Maybe(fromJust)
|
import Data.Maybe(fromJust)
|
||||||
|
import qualified Codec.Binary.UTF8.String as UTF8 (decodeString)
|
||||||
import PGF
|
import PGF
|
||||||
import GF.Compile.ToAPI
|
import GF.Compile.ToAPI
|
||||||
import Network.CGI
|
import Network.CGI
|
||||||
@@ -83,7 +84,7 @@ readParsePGF cwd cache =
|
|||||||
parseEnviron s = do state <- liftIO $ readIO s
|
parseEnviron s = do state <- liftIO $ readIO s
|
||||||
return $ environ state
|
return $ environ state
|
||||||
|
|
||||||
getInp name = maybe err return =<< getInput name
|
getInp name = maybe err (return . UTF8.decodeString) =<< getInput name
|
||||||
where err = throwCGIError 400 ("Missing parameter: "++name) []
|
where err = throwCGIError 400 ("Missing parameter: "++name) []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user