diff options
| author | krasimir <krasimir@chalmers.se> | 2009-02-23 14:17:16 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-02-23 14:17:16 +0000 |
| commit | 6be08d77e01ae418634897de62d44b5b1782566a (patch) | |
| tree | 79e392ca7bfd2ffbb284f804fb6612b748adf5da /src/GF/Compile | |
| parent | b7d2916bbed9d1eec92066061d0fc0d5d35739b4 (diff) | |
fix the handling of flag coding
Diffstat (limited to 'src/GF/Compile')
| -rw-r--r-- | src/GF/Compile/Coding.hs | 11 |
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))) |
