From 429092ac6aa1374a468b36904b4c2c668d892c54 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 1 Oct 2008 16:01:51 +0000 Subject: 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 --- src/GF/Text/Coding.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/GF/Text/Coding.hs (limited to 'src/GF/Text/Coding.hs') 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 -- cgit v1.2.3