summaryrefslogtreecommitdiff
path: root/src/GF/Text/Coding.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-10-01 16:01:51 +0000
committeraarne <aarne@cs.chalmers.se>2008-10-01 16:01:51 +0000
commit429092ac6aa1374a468b36904b4c2c668d892c54 (patch)
tree73d56e3a233b80b8e25a80b5b518802590603718 /src/GF/Text/Coding.hs
parent307042a6a1863854920da7eaae6fbc588457221c (diff)
added mode 'gf --run' for running silently a script ; made quizzes handle character encoding correctly ; for this end, collected coding functions in GF.Text.Coding
Diffstat (limited to 'src/GF/Text/Coding.hs')
-rw-r--r--src/GF/Text/Coding.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/GF/Text/Coding.hs b/src/GF/Text/Coding.hs
new file mode 100644
index 000000000..47aaa5cb5
--- /dev/null
+++ b/src/GF/Text/Coding.hs
@@ -0,0 +1,14 @@
+module GF.Text.Coding where
+
+import GF.Text.UTF8
+import GF.Text.CP1251
+
+encodeUnicode e = case e of
+ "utf8" -> encodeUTF8
+ "cp1251" -> encodeCP1251
+ _ -> id
+
+decodeUnicode e = case e of
+ "utf8" -> decodeUTF8
+ "cp1251" -> decodeCP1251
+ _ -> id