summaryrefslogtreecommitdiff
path: root/src/GF/Text/Coding.hs
blob: ca0322d06288f6503c55dbeccdbea55b4905e019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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" -> encodeCP1252
  _        -> id

decodeUnicode e = case e of
  "utf8"   -> decodeUTF8
  "cp1251" -> decodeCP1251
  "cp1252" -> decodeCP1252
  _        -> id