diff options
| author | krasimir <krasimir@chalmers.se> | 2008-10-25 20:25:09 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2008-10-25 20:25:09 +0000 |
| commit | e816ae237a5112364ad2eb7d8cb4f3295ae711e8 (patch) | |
| tree | 398f4b2b95536b95732ed1bec697c64090cd28a9 /src | |
| parent | a06d2c6d50a9ed088ba497e33da462bfb806fbaa (diff) | |
add cp1252. usefull for Swedish and German
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Text/CP1252.hs | 6 | ||||
| -rw-r--r-- | src/GF/Text/Coding.hs | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/GF/Text/CP1252.hs b/src/GF/Text/CP1252.hs new file mode 100644 index 000000000..1e5affe53 --- /dev/null +++ b/src/GF/Text/CP1252.hs @@ -0,0 +1,6 @@ +module GF.Text.CP1252 where
+
+import Data.Char
+
+decodeCP1252 = map id
+encodeCP1252 = map (\x -> if x <= '\255' then x else '?')
diff --git a/src/GF/Text/Coding.hs b/src/GF/Text/Coding.hs index 47aaa5cb5..f29ae7a54 100644 --- a/src/GF/Text/Coding.hs +++ b/src/GF/Text/Coding.hs @@ -2,13 +2,16 @@ module GF.Text.Coding where import GF.Text.UTF8 import GF.Text.CP1251 +import GF.Text.CP1252 encodeUnicode e = case e of "utf8" -> encodeUTF8 "cp1251" -> encodeCP1251 + "cp1252" -> decodeCP1252 _ -> id decodeUnicode e = case e of "utf8" -> decodeUTF8 "cp1251" -> decodeCP1251 + "cp1252" -> decodeCP1252 _ -> id |
