aboutsummaryrefslogtreecommitdiff
path: root/modules/gcide/webchr.c
blob: 4e851b92ad43a4135776511d6beb5df6a133774e (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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
/* This file is part of GNU Dico.
   Copyright (C) 2012-2019 Sergey Poznyakoff

   GNU Dico is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   any later version.

   GNU Dico is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with GNU Dico.  If not, see <http://www.gnu.org/licenses/>. */

#include <config.h>
#include <stdlib.h>
#include <string.h>
#include "gcide.h"

char gcide_webchr[256][4] = {
/* 00 */ "",
/* 01 */ "",
/* 02 */ "",
/* 03 */ "",
/* 04 */ "",
/* 05 */ "",
/* 06 */ "",
/* 07 */ "",
/* 08 */ "",
/* 09 */ "",
/* 0a */ "",
/* 0b */ "",
/* 0c */ "",
/* 0d */ "",
/* 0e */ "",
/* 0f */ "",
/* 10 */ "",
/* 11 */ "",
/* 12 */ "",
/* 13 */ "",
/* 14 */ "",
/* 15 */ "",
/* 16 */ "",
/* 17 */ "",
/* 18 */ "",
/* 19 */ "",
/* 1a */ "",
/* 1b */ "",
/* 1c */ "",
/* 1d */ "",
/* 1e */ "",
/* 1f */ "",
/* 20 */ "",
/* 21 */ "",
/* 22 */ "",
/* 23 */ "",
/* 24 */ "",
/* 25 */ "",
/* 26 */ "",
/* 27 */ "",
/* 28 */ "",
/* 29 */ "",
/* 2a */ "",
/* 2b */ "",
/* 2c */ "",
/* 2d */ "",
/* 2e */ "",
/* 2f */ "",
/* 30 */ "",
/* 31 */ "",
/* 32 */ "",
/* 33 */ "",
/* 34 */ "",
/* 35 */ "",
/* 36 */ "",
/* 37 */ "",
/* 38 */ "",
/* 39 */ "",
/* 3a */ "",
/* 3b */ "",
/* 3c */ "<",
/* 3d */ "",
/* 3e */ ">",
/* 3f */ "",
/* 40 */ "",
/* 41 */ "",
/* 42 */ "",
/* 43 */ "",
/* 44 */ "",
/* 45 */ "",
/* 46 */ "",
/* 47 */ "",
/* 48 */ "",
/* 49 */ "",
/* 4a */ "",
/* 4b */ "",
/* 4c */ "",
/* 4d */ "",
/* 4e */ "",
/* 4f */ "",
/* 50 */ "",
/* 51 */ "",
/* 52 */ "",
/* 53 */ "",
/* 54 */ "",
/* 55 */ "",
/* 56 */ "",
/* 57 */ "",
/* 58 */ "",
/* 59 */ "",
/* 5a */ "",
/* 5b */ "",
/* 5c */ "",
/* 5d */ "",
/* 5e */ "",
/* 5f */ "",
/* 60 */ "",
/* 61 */ "",
/* 62 */ "",
/* 63 */ "",
/* 64 */ "",
/* 65 */ "",
/* 66 */ "",
/* 67 */ "",
/* 68 */ "",
/* 69 */ "",
/* 6a */ "",
/* 6b */ "",
/* 6c */ "",
/* 6d */ "",
/* 6e */ "",
/* 6f */ "",
/* 70 */ "",
/* 71 */ "",
/* 72 */ "",
/* 73 */ "",
/* 74 */ "",
/* 75 */ "",
/* 76 */ "",
/* 77 */ "",
/* 78 */ "",
/* 79 */ "",
/* 7a */ "",
/* 7b */ "",
/* 7c */ "",
/* 7d */ "",
/* 7e */ "",
/* 7f */ "",
/* 80 */ "Ç",
/* 81 */ "ü",
/* 82 */ "é",
/* 83 */ "â",
/* 84 */ "ä",
/* 85 */ "à",
/* 86 */ "å",
/* 87 */ "ç",
/* 88 */ "ê",
/* 89 */ "ë",
/* 8a */ "è",
/* 8b */ "ï",
/* 8c */ "î",
/* 8d */ "ì",
/* 8e */ "Ä",
/* 8f */ "Å",
/* 90 */ "È",
/* 91 */ "æ",
/* 92 */ "Æ",
/* 93 */ "ô",
/* 94 */ "ö",
/* 95 */ "ò",
/* 96 */ "û",
/* 97 */ "ù",
/* 98 */ "ÿ",
/* 99 */ "Ö",
/* 9a */ "Ü",
/* 9b */ "£",
/* 9c */ "",
/* 9d */ "",
/* 9e */ "",
/* 9f */ "",
/* a0 */ "á",
/* a1 */ "í",
/* a2 */ "ó",
/* a3 */ "ú",
/* a4 */ "ñ",
/* a5 */ "Ñ",
/* a6 */ "⅔",
/* a7 */ "⅓",
/* a8 */ "",
/* a9 */ "˝",
/* aa */ "",
/* ab */ "½",
/* ac */ "¼",
/* ad */ "",
/* ae */ "",
/* af */ "",
/* b0 */ "<?>", /* Place-holder for unknown or illegible character. */
/* b1 */ "",
/* b2 */ "",
/* b3 */ "",
/* b4 */ "↑",
/* b5 */ "☞",   /* pointing hand (printer's "fist") */
/* b6 */ "˝",   /* bold accent */
/* b7 */ "´",   /* light accent */ 
/* b8 */ "”",
/* b9 */ "",
/* ba */ "‖",
/* bb */ "",
/* bc */ "§",
/* bd */ "“",
/* be */ "ā",
/* bf */ "‘",
/* c0 */ "ṉ",   /* "n sub-macron" */
/* c1 */ "♯",
/* c2 */ "♭",
/* c3 */ "–",
/* c4 */ "―",
/* c5 */ "t",   /* First part of th ligature */
/* c6 */ "ī",
/* c7 */ "ē",
/* c8 */ "ḍ",   /* Sanskrit/Tamil d dot */
/* c9 */ "ṇ",   /* Sanskrit/Tamil n dot */
/* ca */ "ṭ",   /* Sanskrit/Tamil t dot */
/* cb */ "ĕ",
/* cc */ "ĭ",
/* cd */ "",
/* ce */ "ŏ",
/* cf */ "‐",   /* short dash */
/* d0 */ "—",
/* d1 */ "Œ",
/* d2 */ "œ",
/* d3 */ "ō",
/* d4 */ "ū",
/* d5 */ "ǒ",
/* d6 */ "ǣ",
/* d7 */ "ōē",  /* FIXME: oe ligature with macron */
/* d8 */ "‖",
/* d9 */ "",
/* da */ "",
/* db */ "",
/* dc */ "ŭ",
/* dd */ "ă",
/* de */ "˘",   /* FIXME: crescent: 1F319? */
/* df */ "ȳ",
/* e0 */ "a",   /* FIXME: a "semilong" (has a macron above with a short */
                /* vertical bar on top the center of the macron) */
/* e1 */ "e",   /* FIXME: e "semilong" */ 
/* e2 */ "i",   /* FIXME: i "semilong" */
/* e3 */ "o",   /* FIXME: o "semilong" */
/* e4 */ "u",   /* FIXME: u "semilong" */
/* e5 */ "ȧ",   /* a with dot above */
/* e6 */ "μ",   
/* e7 */ "h",   /* second part of th ligature */
/* e8 */ "",
/* e9 */ "",
/* ea */ "",
/* eb */ "ð",
/* ec */ "",
/* ed */ "þ",
/* ee */ "ã",
/* ef */ "ṅ",
/* f0 */ "ṛ",
/* f1 */ "",
/* f2 */ "",
/* f3 */ "",
/* f4 */ "ȝ",
/* f5 */ "—",
/* f6 */ "÷",
/* f7 */ "≈",
/* f8 */ "°",
/* f9 */ "•",
/* fa */ "·",
/* fb */ "√",
/* fc */ "",
/* fd */ "",
/* fe */ "",
/* ff */ "",
};

static char xdig[] = "0123456789abcdef";
#define xnum(c) (strchr(xdig, (c)) - xdig)

char const *
gcide_escape_to_utf8(const char *esc)
{
    char const *s = gcide_webchr[xnum(esc[0]) * 16 + xnum(esc[1])];
    return s[0] ? s : NULL;
}


/* Local Variables: */
/* mode: c */
/* eval: (setq buffer-file-coding-system (if window-system 'utf-8 'raw-text-unix)) */
/* End: */

Return to:

Send suggestions and report system problems to the System administrator.