diff options
| author | hallgren <hallgren@chalmers.se> | 2011-11-21 15:15:49 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-11-21 15:15:49 +0000 |
| commit | e9e029d39f5117f233823acc5a2e04f79827529e (patch) | |
| tree | 02faedbf6a6b5746e9470ee959c9b3485329af99 /src/example-based/ExampleService.hs | |
| parent | ccf16172cfeb4b00f211b6397cd6851a7c215984 (diff) | |
example-based: bug fix: apply UTF-8 decoding to CGI inputs
You can now use words with ÅÄÖ when writing Swedish grammars by example...
Diffstat (limited to 'src/example-based/ExampleService.hs')
| -rw-r--r-- | src/example-based/ExampleService.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/example-based/ExampleService.hs b/src/example-based/ExampleService.hs index 185e4fd94..0e88ef414 100644 --- a/src/example-based/ExampleService.hs +++ b/src/example-based/ExampleService.hs @@ -4,6 +4,7 @@ import System.FilePath((</>),makeRelative) import Data.Map(fromList) import Data.Char(isDigit) import Data.Maybe(fromJust) +import qualified Codec.Binary.UTF8.String as UTF8 (decodeString) import PGF import GF.Compile.ToAPI import Network.CGI @@ -83,7 +84,7 @@ readParsePGF cwd cache = parseEnviron s = do state <- liftIO $ readIO s 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) [] |
