diff options
| author | aarne <unknown> | 2004-08-12 18:29:35 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-08-12 18:29:35 +0000 |
| commit | ca280d8d31bd00f9ce19782d0a4761654d04a1c3 (patch) | |
| tree | 56fdc854347e6843f4a4a4b09d88cdabe8a6f33c /src/GF/Shell/CommandL.hs | |
| parent | 35f8c762103b38e475651237964906865e07e9d4 (diff) | |
(non)utf8 input in GUI
Diffstat (limited to 'src/GF/Shell/CommandL.hs')
| -rw-r--r-- | src/GF/Shell/CommandL.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GF/Shell/CommandL.hs b/src/GF/Shell/CommandL.hs index 36e8a5a6d..2bb240018 100644 --- a/src/GF/Shell/CommandL.hs +++ b/src/GF/Shell/CommandL.hs @@ -44,10 +44,13 @@ getCommand = do s <- getLine return $ pCommand s -getCommandUTF :: IO Command -getCommandUTF = do +-- decodes UTF8 if u==False, i.e. if the grammar does not use UTF8; +-- used in the Java GUI, which always uses UTF8 + +getCommandUTF :: Bool -> IO Command +getCommandUTF u = do s <- getLine - return $ pCommand s -- the GUI is doing this: $ decodeUTF8 s + return $ pCommand $ if u then s else decodeUTF8 s pCommand = pCommandWords . words where pCommandWords s = case s of |
