mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
add cp1252. usefull for Swedish and German
This commit is contained in:
6
src/GF/Text/CP1252.hs
Normal file
6
src/GF/Text/CP1252.hs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
module GF.Text.CP1252 where
|
||||||
|
|
||||||
|
import Data.Char
|
||||||
|
|
||||||
|
decodeCP1252 = map id
|
||||||
|
encodeCP1252 = map (\x -> if x <= '\255' then x else '?')
|
||||||
@@ -2,13 +2,16 @@ module GF.Text.Coding where
|
|||||||
|
|
||||||
import GF.Text.UTF8
|
import GF.Text.UTF8
|
||||||
import GF.Text.CP1251
|
import GF.Text.CP1251
|
||||||
|
import GF.Text.CP1252
|
||||||
|
|
||||||
encodeUnicode e = case e of
|
encodeUnicode e = case e of
|
||||||
"utf8" -> encodeUTF8
|
"utf8" -> encodeUTF8
|
||||||
"cp1251" -> encodeCP1251
|
"cp1251" -> encodeCP1251
|
||||||
|
"cp1252" -> decodeCP1252
|
||||||
_ -> id
|
_ -> id
|
||||||
|
|
||||||
decodeUnicode e = case e of
|
decodeUnicode e = case e of
|
||||||
"utf8" -> decodeUTF8
|
"utf8" -> decodeUTF8
|
||||||
"cp1251" -> decodeCP1251
|
"cp1251" -> decodeCP1251
|
||||||
|
"cp1252" -> decodeCP1252
|
||||||
_ -> id
|
_ -> id
|
||||||
|
|||||||
Reference in New Issue
Block a user