diff options
| author | krasimir <krasimir@chalmers.se> | 2010-04-19 09:38:36 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-04-19 09:38:36 +0000 |
| commit | 6313244eacf992fb10a5091bee28582e84540809 (patch) | |
| tree | 8208fb18a5e1ab9447bd060cf08a3d78ed0a8c0a /src/compiler/GF/Compile/Coding.hs | |
| parent | 8b5827fc892c2f395ae26f1811da2d4cc3b1669d (diff) | |
use the native unicode support from GHC 6.12
Diffstat (limited to 'src/compiler/GF/Compile/Coding.hs')
| -rw-r--r-- | src/compiler/GF/Compile/Coding.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/GF/Compile/Coding.hs b/src/compiler/GF/Compile/Coding.hs index b909aac7d..01285eef1 100644 --- a/src/compiler/GF/Compile/Coding.hs +++ b/src/compiler/GF/Compile/Coding.hs @@ -8,12 +8,14 @@ import GF.Infra.Option import GF.Data.Operations import Data.Char +import System.IO +import qualified Data.ByteString.Char8 as BS -encodeStringsInModule :: SourceModule -> SourceModule -encodeStringsInModule = codeSourceModule (encodeUnicode UTF_8) +encodeStringsInModule :: TextEncoding -> SourceModule -> SourceModule +encodeStringsInModule enc = codeSourceModule (BS.unpack . encodeUnicode enc) -decodeStringsInModule :: SourceModule -> SourceModule -decodeStringsInModule mo = codeSourceModule (decodeUnicode (flag optEncoding (flagsModule mo))) mo +decodeStringsInModule :: TextEncoding -> SourceModule -> SourceModule +decodeStringsInModule enc mo = codeSourceModule (decodeUnicode enc . BS.pack) mo codeSourceModule :: (String -> String) -> SourceModule -> SourceModule codeSourceModule co (id,mo) = (id,replaceJudgements mo (mapTree codj (jments mo))) |
