summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Compile.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-03-11 14:37:10 +0000
committeraarne <aarne@cs.chalmers.se>2008-03-11 14:37:10 +0000
commitaa94e340980f715b8d20e6cbc60d989b5c59e6b5 (patch)
treefa604a0657e0e019d6e8fa009b43101b04833583 /src/GF/Compile/Compile.hs
parent5f731b3ad6f19cdcc3b160b63b9b0531c5739ad0 (diff)
coding flag as pragma in files
Diffstat (limited to 'src/GF/Compile/Compile.hs')
-rw-r--r--src/GF/Compile/Compile.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index faece6a99..856544152 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -53,6 +53,7 @@ import GF.Canon.GetGFC
import GF.Data.Operations
import GF.Infra.UseIO
+import GF.Text.UTF8 ----
import GF.System.Arch
import Control.Monad
@@ -338,9 +339,12 @@ generateModuleCode opts path minfo@(name,info) = do
let (file,out) = (gfrFile pname, prGrammar (MGrammar [rminfo]))
putp (" wrote file" +++ file) $ ioeIO $ writeFile file $ compactPrint out
_ -> return ()
+ let encode = case getOptVal opts uniCoding of
+ Just "utf8" -> encodeUTF8
+ _ -> id
(file,out) <- do
code <- return $ MkGFC.prCanonModInfo minfo'
- return (gfcFile pname, code)
+ return (gfcFile pname, encode code)
if emit && nomulti ---- && isCompilable info
then putp (" wrote file" +++ file) $ ioeIO $ writeFile file out
else putpp ("no need to save module" +++ prt name) $ return ()