1
0
forked from GitHub/gf-core

(non)utf8 input in GUI

This commit is contained in:
aarne
2004-08-12 18:29:35 +00:00
parent 35f8c76210
commit ca280d8d31
3 changed files with 16 additions and 4 deletions

View File

@@ -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