From 712717e46133d3396599cfe0f760e357206916c9 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 26 Jun 2008 06:52:01 +0000 Subject: [PATCH] utf8 adjustments --- src/GF/Compile/Export.hs | 3 ++- src/GF/Compile/GrammarToGFCC.hs | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/GF/Compile/Export.hs b/src/GF/Compile/Export.hs index 9e9a99e99..23b8198f8 100644 --- a/src/GF/Compile/Export.hs +++ b/src/GF/Compile/Export.hs @@ -58,4 +58,5 @@ outputConcr pgf = case cncnames pgf of cnc:_ -> cnc printPGF :: PGF -> String -printPGF = encodeUTF8 . printTree . fromPGF +printPGF = ---- encodeUTF8 . -- out by AR26/6/2008: the PGF may already be UTF8 + printTree . fromPGF diff --git a/src/GF/Compile/GrammarToGFCC.hs b/src/GF/Compile/GrammarToGFCC.hs index d14a914f1..e13c8edf2 100644 --- a/src/GF/Compile/GrammarToGFCC.hs +++ b/src/GF/Compile/GrammarToGFCC.hs @@ -99,15 +99,16 @@ canon2gfcc opts pars cgr@(M.MGrammar ((a,M.ModMod abm):cms)) = opers = Map.fromAscList [] -- opers will be created as optimization utf = if moduleFlag optEncoding (moduleOptions (M.flags mo)) == UTF_8 then D.convertStringsInTerm decodeUTF8 else id + umkTerm = utf . mkTerm lins = Map.fromAscList - [(i2i f, utf (mkTerm tr)) | (f,CncFun _ (Yes tr) _) <- js] + [(i2i f, umkTerm tr) | (f,CncFun _ (Yes tr) _) <- js] lincats = Map.fromAscList [(i2i c, mkCType ty) | (c,CncCat (Yes ty) _ _) <- js] lindefs = Map.fromAscList - [(i2i c, mkTerm tr) | (c,CncCat _ (Yes tr) _) <- js] + [(i2i c, umkTerm tr) | (c,CncCat _ (Yes tr) _) <- js] printnames = Map.union - (Map.fromAscList [(i2i f, mkTerm tr) | (f,CncFun _ _ (Yes tr)) <- js]) - (Map.fromAscList [(i2i f, mkTerm tr) | (f,CncCat _ _ (Yes tr)) <- js]) + (Map.fromAscList [(i2i f, umkTerm tr) | (f,CncFun _ _ (Yes tr)) <- js]) + (Map.fromAscList [(i2i f, umkTerm tr) | (f,CncCat _ _ (Yes tr)) <- js]) params = Map.fromAscList [(i2i c, pars lang0 c) | (c,CncCat (Yes ty) _ _) <- js] fcfg = Nothing