aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/text/encoding.lux
blob: 83474b909e005380da9f4fec386fbcf5455df6ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
(.module:
  [library
   [lux #*
    [macro
     ["." template]]
    [type
     abstract]]])

... https://en.wikipedia.org/wiki/Character_encoding#Common_character_encodings
(abstract: .public Encoding
  {#.doc (example "Encoding formats for text.")}
  
  Text

  (template [<name> <encoding>]
    [(`` (def: .public <name>
           {#.doc (example (~~ (template.text ["'" <encoding> "' text encoding. "])))}
           Encoding
           (:abstraction <encoding>)))]

    [ascii "ASCII"]

    [ibm_037 "IBM037"]
    [ibm_273 "IBM273"]
    [ibm_277 "IBM277"]
    [ibm_278 "IBM278"]
    [ibm_280 "IBM280"]
    [ibm_284 "IBM284"]
    [ibm_285 "IBM285"]
    [ibm_290 "IBM290"]
    [ibm_297 "IBM297"]
    [ibm_300 "IBM300"]
    [ibm_420 "IBM420"]
    [ibm_424 "IBM424"]
    [ibm_437 "IBM437"]
    [ibm_500 "IBM500"]
    [ibm_737 "IBM737"]
    [ibm_775 "IBM775"]
    [ibm_833 "IBM833"]
    [ibm_834 "IBM834"]
    [ibm_838 "IBM-Thai"]
    [ibm_850 "IBM850"]
    [ibm_852 "IBM852"]
    [ibm_855 "IBM855"]
    [ibm_856 "IBM856"]
    [ibm_857 "IBM857"]
    [ibm_858 "IBM00858"]
    [ibm_860 "IBM860"]
    [ibm_861 "IBM861"]
    [ibm_862 "IBM862"]
    [ibm_863 "IBM863"]
    [ibm_864 "IBM864"]
    [ibm_865 "IBM865"]
    [ibm_866 "IBM866"]
    [ibm_868 "IBM868"]
    [ibm_869 "IBM869"]
    [ibm_870 "IBM870"]
    [ibm_871 "IBM871"]
    [ibm_874 "IBM874"]
    [ibm_875 "IBM875"]
    [ibm_918 "IBM918"]
    [ibm_921 "IBM921"]
    [ibm_922 "IBM922"]
    [ibm_930 "IBM930"]
    [ibm_933 "IBM933"]
    [ibm_935 "IBM935"]
    [ibm_937 "IBM937"]
    [ibm_939 "IBM939"]
    [ibm_942 "IBM942"]
    [ibm_942c "IBM942C"]
    [ibm_943 "IBM943"]
    [ibm_943c "IBM943C"]
    [ibm_948 "IBM948"]
    [ibm_949 "IBM949"]
    [ibm_949c "IBM949C"]
    [ibm_950 "IBM950"]
    [ibm_964 "IBM964"]
    [ibm_970 "IBM970"]
    [ibm_1006 "IBM1006"]
    [ibm_1025 "IBM1025"]
    [ibm_1026 "IBM1026"]
    [ibm_1046 "IBM1046"]
    [ibm_1047 "IBM1047"]
    [ibm_1097 "IBM1097"]
    [ibm_1098 "IBM1098"]
    [ibm_1112 "IBM1112"]
    [ibm_1122 "IBM1122"]
    [ibm_1123 "IBM1123"]
    [ibm_1124 "IBM1124"]
    [ibm_1140 "IBM01140"]
    [ibm_1141 "IBM01141"]
    [ibm_1142 "IBM01142"]
    [ibm_1143 "IBM01143"]
    [ibm_1144 "IBM01144"]
    [ibm_1145 "IBM01145"]
    [ibm_1146 "IBM01146"]
    [ibm_1147 "IBM01147"]
    [ibm_1148 "IBM01148"]
    [ibm_1149 "IBM01149"]
    [ibm_1166 "IBM1166"]
    [ibm_1364 "IBM1364"]
    [ibm_1381 "IBM1381"]
    [ibm_1383 "IBM1383"]
    [ibm_33722 "IBM33722"]
    
    [iso_2022_cn "ISO-2022-CN"]
    [iso2022_cn_cns "ISO2022-CN-CNS"]
    [iso2022_cn_gb "ISO2022-CN-GB"]
    [iso_2022_jp "ISO-2022-JP"]
    [iso_2022_jp_2 "ISO-2022-JP-2"]
    [iso_2022_kr "ISO-2022-KR"]
    [iso_8859_1 "ISO-8859-1"]
    [iso_8859_2 "ISO-8859-2"]
    [iso_8859_3 "ISO-8859-3"]
    [iso_8859_4 "ISO-8859-4"]
    [iso_8859_5 "ISO-8859-5"]
    [iso_8859_6 "ISO-8859-6"]
    [iso_8859_7 "ISO-8859-7"]
    [iso_8859_8 "ISO-8859-8"]
    [iso_8859_9 "ISO-8859-9"]
    [iso_8859_11 "iso-8859-11"]
    [iso_8859_13 "ISO-8859-13"]
    [iso_8859_15 "ISO-8859-15"]

    [mac_arabic "MacArabic"]
    [mac_central_europe "MacCentralEurope"]
    [mac_croatian "MacCroatian"]
    [mac_cyrillic "MacCyrillic"]
    [mac_dingbat "MacDingbat"]
    [mac_greek "MacGreek"]
    [mac_hebrew "MacHebrew"]
    [mac_iceland "MacIceland"]
    [mac_roman "MacRoman"]
    [mac_romania "MacRomania"]
    [mac_symbol "MacSymbol"]
    [mac_thai "MacThai"]
    [mac_turkish "MacTurkish"]
    [mac_ukraine "MacUkraine"]
    
    [utf_8 "UTF-8"]
    [utf_16 "UTF-16"]
    [utf_32 "UTF-32"]

    [windows_31j "windows-31j"]
    [windows_874 "windows-874"]
    [windows_949 "windows-949"]
    [windows_950 "windows-950"]
    [windows_1250 "windows-1250"]
    [windows_1252 "windows-1252"]
    [windows_1251 "windows-1251"]
    [windows_1253 "windows-1253"]
    [windows_1254 "windows-1254"]
    [windows_1255 "windows-1255"]
    [windows_1256 "windows-1256"]
    [windows_1257 "windows-1257"]
    [windows_1258 "windows-1258"]
    [windows_iso2022jp "windows-iso2022jp"]
    [windows_50220 "windows-50220"]
    [windows_50221 "windows-50221"]
    
    [cesu_8 "CESU-8"]
    [koi8_r "KOI8-R"]
    [koi8_u "KOI8-U"]
    )

  (def: .public name
    (-> Encoding Text)
    (|>> :representation))
  )