summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/Coding.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/GF/Compile/Coding.hs b/src/GF/Compile/Coding.hs
index 511ceddef..0891c4546 100644
--- a/src/GF/Compile/Coding.hs
+++ b/src/GF/Compile/Coding.hs
@@ -2,8 +2,7 @@ module GF.Compile.Coding where
import GF.Grammar.Grammar
import GF.Grammar.Macros
-import GF.Text.UTF8
-import GF.Text.CP1251
+import GF.Text.Coding
import GF.Infra.Modules
import GF.Infra.Option
import GF.Data.Operations
@@ -11,14 +10,10 @@ import GF.Data.Operations
import Data.Char
encodeStringsInModule :: SourceModule -> SourceModule
-encodeStringsInModule = codeSourceModule encodeUTF8
+encodeStringsInModule = codeSourceModule (encodeUnicode UTF_8)
decodeStringsInModule :: SourceModule -> SourceModule
-decodeStringsInModule mo =
- case flag optEncoding (flagsModule mo) of
- UTF_8 -> codeSourceModule decodeUTF8 mo
- CP_1251 -> codeSourceModule decodeCP1251 mo
- _ -> mo
+decodeStringsInModule mo = codeSourceModule (decodeUnicode (flag optEncoding (flagsModule mo))) mo
codeSourceModule :: (String -> String) -> SourceModule -> SourceModule
codeSourceModule co (id,mo) = (id,replaceJudgements mo (mapTree codj (jments mo)))