Merge branch 'vim' into fix/fast-join
[vim_extended.git] / src / digraph.c
blobb867598a627cf211250c182c253a2924b69dc116
1 /* vi:set ts=8 sts=4 sw=4:
3 * VIM - Vi IMproved by Bram Moolenaar
5 * Do ":help uganda" in Vim to read copying and usage conditions.
6 * Do ":help credits" in Vim to see a list of people who contributed.
7 * See README.txt for an overview of the Vim source code.
8 */
11 * digraph.c: code for digraphs
14 #include "vim.h"
16 #if defined(FEAT_DIGRAPHS) || defined(PROTO)
18 #ifdef FEAT_MBYTE
19 typedef int result_T;
20 #else
21 typedef char_u result_T;
22 #endif
24 typedef struct digraph
26 char_u char1;
27 char_u char2;
28 result_T result;
29 } digr_T;
31 static int getexactdigraph __ARGS((int, int, int));
32 static void printdigraph __ARGS((digr_T *));
34 /* digraphs added by the user */
35 static garray_T user_digraphs = {0, 0, sizeof(digr_T), 10, NULL};
38 * Note: Characters marked with XX are not included literally, because some
39 * compilers cannot handle them (Amiga SAS/C is the most picky one).
41 static digr_T digraphdefault[] =
42 #if defined(MSDOS) || defined(OS2)
44 * MSDOS digraphs.
46 {{'C', ',', 128}, /* ~@ XX */
47 {'u', '"', 129}, /* � */
48 {'e', '\'', 130}, /* ‚ */
49 {'a', '^', 131}, /* ƒ */
50 {'a', '"', 132}, /* „ */
51 {'a', '`', 133}, /* … */
52 {'a', '@', 134}, /* † */
53 {'c', ',', 135}, /* ~G XX */
54 {'e', '^', 136}, /* ~H XX */
55 {'e', '"', 137}, /* ‰ */
56 {'e', '`', 138}, /* Š */
57 {'i', '"', 139}, /* ‹ */
58 {'i', '^', 140}, /* Œ */
59 {'i', '`', 141}, /* � */
60 {'A', '"', 142}, /* ~N XX */
61 {'A', '@', 143}, /* � */
62 {'E', '\'', 144}, /* � */
63 {'a', 'e', 145}, /* ‘ */
64 {'A', 'E', 146}, /* ’ */
65 {'o', '^', 147}, /* “ */
66 {'o', '"', 148}, /* ” */
67 {'o', '`', 149}, /* • */
68 {'u', '^', 150}, /* – */
69 {'u', '`', 151}, /* — */
70 {'y', '"', 152}, /* ˜ */
71 {'O', '"', 153}, /* ™ */
72 {'U', '"', 154}, /* š */
73 {'c', '|', 155}, /* › */
74 {'$', '$', 156}, /* œ */
75 {'Y', '-', 157}, /* ~] XX */
76 {'P', 't', 158}, /* ž */
77 {'f', 'f', 159}, /* Ÿ */
78 {'a', '\'', 160}, /*   */
79 {'i', '\'', 161}, /* ¡ */
80 {'o', '\'', 162}, /* ¢ */
81 {'u', '\'', 163}, /* x XX */
82 {'n', '~', 164}, /* ¤ */
83 {'N', '~', 165}, /* ¥ */
84 {'a', 'a', 166}, /* ¦ */
85 {'o', 'o', 167}, /* § */
86 {'~', '?', 168}, /* ¨ */
87 {'-', 'a', 169}, /* © */
88 {'a', '-', 170}, /* ª */
89 {'1', '2', 171}, /* « */
90 {'1', '4', 172}, /* ¬ */
91 {'~', '!', 173}, /* ­ */
92 {'<', '<', 174}, /* ® */
93 {'>', '>', 175}, /* ¯ */
95 {'s', 's', 225}, /* á */
96 {'j', 'u', 230}, /* æ */
97 {'o', '/', 237}, /* í */
98 {'+', '-', 241}, /* ñ */
99 {'>', '=', 242}, /* ò */
100 {'<', '=', 243}, /* ó */
101 {':', '-', 246}, /* ö */
102 {'~', '~', 247}, /* ÷ */
103 {'~', 'o', 248}, /* ø */
104 {'2', '2', 253}, /* ý */
105 {NUL, NUL, NUL}
108 #else /* !MSDOS && !OS2 */
109 # ifdef __MINT__
112 * ATARI digraphs
114 {{'C', ',', 128}, /* ~@ XX */
115 {'u', '"', 129}, /* � */
116 {'e', '\'', 130}, /* ‚ */
117 {'a', '^', 131}, /* ƒ */
118 {'a', '"', 132}, /* „ */
119 {'a', '`', 133}, /* … */
120 {'a', '@', 134}, /* † */
121 {'c', ',', 135}, /* ~G XX */
122 {'e', '^', 136}, /* ~H XX */
123 {'e', '"', 137}, /* ‰ */
124 {'e', '`', 138}, /* Š */
125 {'i', '"', 139}, /* ‹ */
126 {'i', '^', 140}, /* Œ */
127 {'i', '`', 141}, /* � */
128 {'A', '"', 142}, /* Ž */
129 {'A', '@', 143}, /* � */
130 {'E', '\'', 144}, /* � */
131 {'a', 'e', 145}, /* ‘ */
132 {'A', 'E', 146}, /* ’ */
133 {'o', '^', 147}, /* “ */
134 {'o', '"', 148}, /* ” */
135 {'o', '`', 149}, /* • */
136 {'u', '^', 150}, /* – */
137 {'u', '`', 151}, /* — */
138 {'y', '"', 152}, /* ˜ */
139 {'O', '"', 153}, /* ™ */
140 {'U', '"', 154}, /* š */
141 {'c', '|', 155}, /* › */
142 {'$', '$', 156}, /* œ */
143 {'Y', '-', 157}, /* ~] XX */
144 {'s', 's', 158}, /* ž */
145 {'f', 'f', 159}, /* Ÿ */
146 {'a', '\'', 160}, /*   */
147 {'i', '\'', 161}, /* ¡ */
148 {'o', '\'', 162}, /* ¢ */
149 {'u', '\'', 163}, /* £ */
150 {'n', '~', 164}, /* ¤ */
151 {'N', '~', 165}, /* ¥ */
152 {'a', 'a', 166}, /* ¦ */
153 {'o', 'o', 167}, /* § */
154 {'~', '?', 168}, /* ¨ */
155 {'-', 'a', 169}, /* © */
156 {'a', '-', 170}, /* ª */
157 {'1', '2', 171}, /* « */
158 {'1', '4', 172}, /* ¬ */
159 {'~', '!', 173}, /* ­ */
160 {'<', '<', 174}, /* ® */
161 {'>', '>', 175}, /* ¯ */
162 {'j', 'u', 230}, /* æ */
163 {'o', '/', 237}, /* í */
164 {'+', '-', 241}, /* ñ */
165 {'>', '=', 242}, /* ò */
166 {'<', '=', 243}, /* ó */
167 {':', '-', 246}, /* ö */
168 {'~', '~', 247}, /* ÷ */
169 {'~', 'o', 248}, /* ø */
170 {'2', '2', 253}, /* ý */
171 {NUL, NUL, NUL}
174 # else /* !__MINT__ */
175 # ifdef HPUX_DIGRAPHS
178 * different HPUX digraphs
180 {{'A', '`', 161}, /* ¡ */
181 {'A', '^', 162}, /* ¢ */
182 {'E', '`', 163}, /* £ */
183 {'E', '^', 164}, /* ¤ */
184 {'E', '"', 165}, /* ¥ */
185 {'I', '^', 166}, /* ¦ */
186 {'I', '"', 167}, /* § */
187 {'\'', '\'', 168}, /* ¨ */
188 {'`', '`', 169}, /* © */
189 {'^', '^', 170}, /* ª */
190 {'"', '"', 171}, /* « */
191 {'~', '~', 172}, /* ¬ */
192 {'U', '`', 173}, /* ­ */
193 {'U', '^', 174}, /* ® */
194 {'L', '=', 175}, /* ¯ */
195 {'~', '_', 176}, /* ° */
196 {'Y', '\'', 177}, /* ± */
197 {'y', '\'', 178}, /* ² */
198 {'~', 'o', 179}, /* ³ */
199 {'C', ',', 180}, /* ´ */
200 {'c', ',', 181}, /* µ */
201 {'N', '~', 182}, /* ¶ */
202 {'n', '~', 183}, /* · */
203 {'~', '!', 184}, /* ¸ */
204 {'~', '?', 185}, /* ¹ */
205 {'o', 'x', 186}, /* º */
206 {'L', '-', 187}, /* » */
207 {'Y', '=', 188}, /* ¼ */
208 {'p', 'p', 189}, /* ½ */
209 {'f', 'l', 190}, /* ¾ */
210 {'c', '|', 191}, /* ¿ */
211 {'a', '^', 192}, /* À */
212 {'e', '^', 193}, /* Á */
213 {'o', '^', 194}, /* Â */
214 {'u', '^', 195}, /* Ã */
215 {'a', '\'', 196}, /* Ä */
216 {'e', '\'', 197}, /* Å */
217 {'o', '\'', 198}, /* Æ */
218 {'u', '\'', 199}, /* Ç */
219 {'a', '`', 200}, /* È */
220 {'e', '`', 201}, /* É */
221 {'o', '`', 202}, /* Ê */
222 {'u', '`', 203}, /* Ë */
223 {'a', '"', 204}, /* Ì */
224 {'e', '"', 205}, /* Í */
225 {'o', '"', 206}, /* Î */
226 {'u', '"', 207}, /* Ï */
227 {'A', 'o', 208}, /* Ð */
228 {'i', '^', 209}, /* Ñ */
229 {'O', '/', 210}, /* Ò */
230 {'A', 'E', 211}, /* Ó */
231 {'a', 'o', 212}, /* Ô */
232 {'i', '\'', 213}, /* Õ */
233 {'o', '/', 214}, /* Ö */
234 {'a', 'e', 215}, /* × */
235 {'A', '"', 216}, /* Ø */
236 {'i', '`', 217}, /* Ù */
237 {'O', '"', 218}, /* Ú */
238 {'U', '"', 219}, /* Û */
239 {'E', '\'', 220}, /* Ü */
240 {'i', '"', 221}, /* Ý */
241 {'s', 's', 222}, /* Þ */
242 {'O', '^', 223}, /* ß */
243 {'A', '\'', 224}, /* à */
244 {'A', '~', 225}, /* á */
245 {'a', '~', 226}, /* â */
246 {'D', '-', 227}, /* ã */
247 {'d', '-', 228}, /* ä */
248 {'I', '\'', 229}, /* å */
249 {'I', '`', 230}, /* æ */
250 {'O', '\'', 231}, /* ç */
251 {'O', '`', 232}, /* è */
252 {'O', '~', 233}, /* é */
253 {'o', '~', 234}, /* ê */
254 {'S', '~', 235}, /* ë */
255 {'s', '~', 236}, /* ì */
256 {'U', '\'', 237}, /* í */
257 {'Y', '"', 238}, /* î */
258 {'y', '"', 239}, /* ï */
259 {'p', '-', 240}, /* ð */
260 {'p', '~', 241}, /* ñ */
261 {'~', '.', 242}, /* ò */
262 {'j', 'u', 243}, /* ó */
263 {'P', 'p', 244}, /* ô */
264 {'3', '4', 245}, /* õ */
265 {'-', '-', 246}, /* ö */
266 {'1', '4', 247}, /* ÷ */
267 {'1', '2', 248}, /* ø */
268 {'a', '_', 249}, /* ù */
269 {'o', '_', 250}, /* ú */
270 {'<', '<', 251}, /* û */
271 {'x', 'x', 252}, /* ü */
272 {'>', '>', 253}, /* ý */
273 {'+', '-', 254}, /* þ */
274 {'n', 'u', 255}, /* x XX */
275 {NUL, NUL, NUL}
278 # else /* !HPUX_DIGRAPHS */
280 # ifdef EBCDIC
283 * EBCDIC - ISO digraphs
284 * TODO: EBCDIC Table is Code-Page 1047
286 {{'a', '^', 66}, /* â */
287 {'a', '"', 67}, /* ä */
288 {'a', '`', 68}, /* à */
289 {'a', '\'', 69}, /* á */
290 {'a', '~', 70}, /* ã */
291 {'a', '@', 71}, /* å */
292 {'a', 'a', 71}, /* å */
293 {'c', ',', 72}, /* ç */
294 {'n', '~', 73}, /* ñ */
295 {'c', '|', 74}, /* ¢ */
296 {'e', '\'', 81}, /* é */
297 {'e', '^', 82}, /* ê */
298 {'e', '"', 83}, /* ë */
299 {'e', '`', 84}, /* è */
300 {'i', '\'', 85}, /* í */
301 {'i', '^', 86}, /* î */
302 {'i', '"', 87}, /* ï */
303 {'i', '`', 88}, /* ì */
304 {'s', 's', 89}, /* ß */
305 {'A', '^', 98}, /* Â */
306 {'A', '"', 99}, /* Ä */
307 {'A', '`', 100}, /* À */
308 {'A', '\'', 101}, /* Á */
309 {'A', '~', 102}, /* Ã */
310 {'A', '@', 103}, /* Å */
311 {'A', 'A', 103}, /* Å */
312 {'C', ',', 104}, /* Ç */
313 {'N', '~', 105}, /* Ñ */
314 {'|', '|', 106}, /* ¦ */
315 {'o', '/', 112}, /* ø */
316 {'E', '\'', 113}, /* É */
317 {'E', '^', 114}, /* Ê */
318 {'E', '"', 115}, /* Ë */
319 {'E', '`', 116}, /* È */
320 {'I', '\'', 117}, /* Í */
321 {'I', '^', 118}, /* Î */
322 {'I', '"', 119}, /* Ï */
323 {'I', '`', 120}, /* Ì */
324 {'O', '/', 128}, /* 0/ XX */
325 {'<', '<', 138}, /* « */
326 {'>', '>', 139}, /* » */
327 {'d', '-', 140}, /* ð */
328 {'y', '\'', 141}, /* ý */
329 {'i', 'p', 142}, /* þ */
330 {'+', '-', 143}, /* ± */
331 {'~', 'o', 144}, /* ° */
332 {'a', '-', 154}, /* ª */
333 {'o', '-', 155}, /* º */
334 {'a', 'e', 156}, /* æ */
335 {',', ',', 157}, /* , XX */
336 {'A', 'E', 158}, /* Æ */
337 {'o', 'x', 159}, /* ¤ - currency symbol in ISO 8859-1 */
338 {'e', '=', 159}, /* ¤ - euro symbol in ISO 8859-15 */
339 {'E', 'u', 159}, /* ¤ - euro symbol in ISO 8859-15 */
340 {'j', 'u', 160}, /* µ */
341 {'y', '"', 167}, /* x XX */
342 {'~', '!', 170}, /* ¡ */
343 {'~', '?', 171}, /* ¿ */
344 {'D', '-', 172}, /* Ð */
345 {'I', 'p', 174}, /* Þ */
346 {'r', 'O', 175}, /* ® */
347 {'-', ',', 176}, /* ¬ */
348 {'$', '$', 177}, /* £ */
349 {'Y', '-', 178}, /* ¥ */
350 {'~', '.', 179}, /* · */
351 {'c', 'O', 180}, /* © */
352 {'p', 'a', 181}, /* § */
353 {'p', 'p', 182}, /* ¶ */
354 {'1', '4', 183}, /* ¼ */
355 {'1', '2', 184}, /* ½ */
356 {'3', '4', 185}, /* ¾ */
357 {'Y', '\'', 186}, /* Ý */
358 {'"', '"', 187}, /* ¨ */
359 {'-', '=', 188}, /* ¯ */
360 {'\'', '\'', 190}, /* ´ */
361 {'O', 'E', 191}, /* × - OE in ISO 8859-15 */
362 {'/', '\\', 191}, /* × - multiplication symbol in ISO 8859-1 */
363 {'-', '-', 202}, /* ­ */
364 {'o', '^', 203}, /* ô */
365 {'o', '"', 204}, /* ö */
366 {'o', '`', 205}, /* ò */
367 {'o', '\'', 206}, /* ó */
368 {'o', '~', 207}, /* õ */
369 {'1', '1', 218}, /* ¹ */
370 {'u', '^', 219}, /* û */
371 {'u', '"', 220}, /* ü */
372 {'u', '`', 221}, /* ù */
373 {'u', '\'', 222}, /* ú */
374 {':', '-', 225}, /* ÷ - division symbol in ISO 8859-1 */
375 {'o', 'e', 225}, /* ÷ - oe in ISO 8859-15 */
376 {'2', '2', 234}, /* ² */
377 {'O', '^', 235}, /* Ô */
378 {'O', '"', 236}, /* Ö */
379 {'O', '`', 237}, /* Ò */
380 {'O', '\'', 238}, /* Ó */
381 {'O', '~', 239}, /* Õ */
382 {'3', '3', 250}, /* ³ */
383 {'U', '^', 251}, /* Û */
384 {'U', '"', 252}, /* Ü */
385 {'U', '`', 253}, /* Ù */
386 {'U', '\'', 254}, /* Ú */
387 {NUL, NUL, NUL}
390 # else
391 # if defined(MACOS) && !defined(FEAT_MBYTE)
394 * Macintosh digraphs
396 {{'a', 't', 64}, /* @ */
397 {'A', '"', 128}, /* ~@ XX */
398 {'A', 'o', 129}, /* Å */
399 {'C', ',', 130}, /* Ç */
400 {'E', '\'', 131}, /* É */
401 {'N', '~', 132}, /* Ñ */
402 {'O', '"', 133}, /* Ö */
403 {'U', '"', 134}, /* Ü */
404 {'a', '\'', 135}, /* ~G XX */
405 {'a', '`', 136}, /* ~H XX */
406 {'a', '^', 137}, /* â */
407 {'a', '"', 138}, /* ä */
408 {'a', '~', 139}, /* ã */
409 {'a', 'o', 140}, /* å */
410 {'c', ',', 141}, /* ç */
411 {'e', '\'', 142}, /* é */
412 {'e', '`', 143}, /* è */
413 {'e', '^', 144}, /* ê */
414 {'e', '"', 145}, /* ë */
415 {'i', '\'', 146}, /* í */
416 {'i', '`', 147}, /* ì */
417 {'i', '^', 148}, /* î */
418 {'i', '"', 149}, /* ï */
419 {'n', '~', 150}, /* ñ */
420 {'o', '\'', 151}, /* ó */
421 {'o', '`', 152}, /* ò */
422 {'o', '^', 153}, /* ô */
423 {'o', '"', 154}, /* ö */
424 {'o', '~', 155}, /* o */
425 {'u', '\'', 156}, /* ú */
426 {'u', '`', 157}, /* ~] XX */
427 {'u', '^', 158}, /* û */
428 {'u', '"', 159}, /* ü */
429 {'+', '_', 160}, /* Ý */
430 {'~', 'o', 161}, /* ° */
431 {'c', '|', 162}, /* ¢ */
432 {'$', '$', 163}, /* £ */
433 {'p', 'a', 164}, /* § */
434 {'.', '.', 165}, /* * */
435 {'P', 'P', 166}, /* ¶ */
436 {'s', 's', 167}, /* ß */
437 {'r', 'O', 168}, /* ® */
438 {'c', 'O', 169}, /* © */
439 {'T', 'M', 170}, /* � */
440 {'=', '/', 173}, /* ‚ */
441 {'A', 'E', 174}, /* Æ */
442 {'O', '/', 175}, /* Ø */
443 {'0', '0', 176}, /* ƒ */
444 {'+', '-', 177}, /* ± */
445 {'<', '=', 178}, /* ¾ */
446 {'>', '=', 179}, /* „ */
447 {'Y', '-', 180}, /* ¥ */
448 {'j', 'u', 181}, /* µ */
449 {'m', 'u', 181}, /* µ */
450 {'d', 'd', 182}, /* � */
451 {'S', 'S', 183}, /* … */
452 {'S', 'I', 183}, /* … */
453 {'P', 'I', 184}, /* ½ */
454 {'p', 'i', 185}, /* ¼ */
455 {'I', 'I', 186}, /* † */
456 {'a', '-', 187}, /* » */
457 {'o', '-', 188}, /* º */
458 {'O', 'M', 189}, /* ½ */
459 {'a', 'e', 190}, /* æ */
460 {'o', '/', 191}, /* ø */
461 {'~', '?', 192}, /* ¿ */
462 {'~', '!', 193}, /* ¡ */
463 {'-', ',', 194}, /* ¬ */
464 {'v', '-', 195}, /* ~H XX */
465 {'f', '-', 196}, /* Ÿ */
466 {'~', '~', 197}, /* ‰ */
467 {'D', 'E', 198}, /* � */
468 {'<', '<', 199}, /* « */
469 {'>', '>', 200}, /* » */
470 {'.', ':', 201}, /* Š */
471 {'A', '`', 203}, /* À */
472 {'A', '~', 204}, /* Ã */
473 {'O', '~', 205}, /* Õ */
474 {'O', 'E', 206}, /* ‘ */
475 {'o', 'e', 207}, /* ¦ */
476 {'-', '.', 208}, /* - */
477 {'-', '-', 209}, /* - */
478 {'`', '`', 210}, /* " */
479 {'\'', '\'', 211}, /* " */
480 {'`', ' ', 212}, /* ' */
481 {'\'', ' ', 213}, /* ' */
482 {'-', ':', 214}, /* ÷ */
483 {'D', 'I', 215}, /* × */
484 {'y', ':', 216}, /* ÿ */
485 {'Y', ':', 217}, /* � */
486 {'/', '/', 218}, /* Ž */
487 {'E', '=', 219}, /* ¤ Euro System >=8.5 */
488 {'o', 'x', 219}, /* ¤ Currency System <=8.1*/
489 {'<', ' ', 220}, /* Ð */
490 {'>', ' ', 221}, /* ð */
491 {'f', 'i', 222}, /* Þ */
492 {'f', 'l', 223}, /* þ */
493 {'+', '+', 224}, /* ý */
494 {'~', '.', 225}, /* · */
495 {',', ' ', 226}, /* ’ */
496 {',', ',', 227}, /* “ */
497 {'%', '.', 228}, /* ” */
498 {'%', '0', 228}, /* ” */
499 {'A', '^', 229}, /* Â */
500 {'E', '^', 230}, /* Ê */
501 {'A', '\'', 231}, /* Á */
502 {'E', '"', 232}, /* Ë */
503 {'E', '`', 233}, /* È */
504 {'I', '\'', 234}, /* Í */
505 {'I', '^', 235}, /* Î */
506 {'I', '"', 236}, /* Ï */
507 {'I', '`', 237}, /* Ì */
508 {'O', '\'', 238}, /* Ó */
509 {'O', '^', 239}, /* Ô */
510 {'A', 'P', 240}, /* • */
511 {'O', '`', 241}, /* Ò */
512 {'U', '\'', 242}, /* Ú */
513 {'U', '^', 243}, /* Û */
514 {'U', '`', 244}, /* Ù */
515 {'i', '.', 245}, /* ž */
516 {NUL, NUL, NUL}
519 # else /* !MACOS */
521 # ifdef OLD_DIGRAPHS
524 * digraphs compatible with Vim 5.x
526 {{'~', '!', 161}, /* ¡ */
527 {'c', '|', 162}, /* ¢ */
528 {'$', '$', 163}, /* £ */
529 {'o', 'x', 164}, /* ¤ - currency symbol in ISO 8859-1 */
530 {'e', '=', 164}, /* ¤ - euro symbol in ISO 8859-15 */
531 {'Y', '-', 165}, /* ¥ */
532 {'|', '|', 166}, /* ¦ */
533 {'p', 'a', 167}, /* § */
534 {'"', '"', 168}, /* ¨ */
535 {'c', 'O', 169}, /* © */
536 {'a', '-', 170}, /* ª */
537 {'<', '<', 171}, /* « */
538 {'-', ',', 172}, /* ¬ */
539 {'-', '-', 173}, /* ­ */
540 {'r', 'O', 174}, /* ® */
541 {'-', '=', 175}, /* ¯ */
542 {'~', 'o', 176}, /* ° */
543 {'+', '-', 177}, /* ± */
544 {'2', '2', 178}, /* ² */
545 {'3', '3', 179}, /* ³ */
546 {'\'', '\'', 180}, /* ´ */
547 {'j', 'u', 181}, /* µ */
548 {'p', 'p', 182}, /* ¶ */
549 {'~', '.', 183}, /* · */
550 {',', ',', 184}, /* ¸ */
551 {'1', '1', 185}, /* ¹ */
552 {'o', '-', 186}, /* º */
553 {'>', '>', 187}, /* » */
554 {'1', '4', 188}, /* ¼ */
555 {'1', '2', 189}, /* ½ */
556 {'3', '4', 190}, /* ¾ */
557 {'~', '?', 191}, /* ¿ */
558 {'A', '`', 192}, /* À */
559 {'A', '\'', 193}, /* Á */
560 {'A', '^', 194}, /* Â */
561 {'A', '~', 195}, /* Ã */
562 {'A', '"', 196}, /* Ä */
563 {'A', '@', 197}, /* Å */
564 {'A', 'A', 197}, /* Å */
565 {'A', 'E', 198}, /* Æ */
566 {'C', ',', 199}, /* Ç */
567 {'E', '`', 200}, /* È */
568 {'E', '\'', 201}, /* É */
569 {'E', '^', 202}, /* Ê */
570 {'E', '"', 203}, /* Ë */
571 {'I', '`', 204}, /* Ì */
572 {'I', '\'', 205}, /* Í */
573 {'I', '^', 206}, /* Î */
574 {'I', '"', 207}, /* Ï */
575 {'D', '-', 208}, /* Ð */
576 {'N', '~', 209}, /* Ñ */
577 {'O', '`', 210}, /* Ò */
578 {'O', '\'', 211}, /* Ó */
579 {'O', '^', 212}, /* Ô */
580 {'O', '~', 213}, /* Õ */
581 {'O', '"', 214}, /* Ö */
582 {'/', '\\', 215}, /* × - multiplication symbol in ISO 8859-1 */
583 {'O', 'E', 215}, /* × - OE in ISO 8859-15 */
584 {'O', '/', 216}, /* Ø */
585 {'U', '`', 217}, /* Ù */
586 {'U', '\'', 218}, /* Ú */
587 {'U', '^', 219}, /* Û */
588 {'U', '"', 220}, /* Ü */
589 {'Y', '\'', 221}, /* Ý */
590 {'I', 'p', 222}, /* Þ */
591 {'s', 's', 223}, /* ß */
592 {'a', '`', 224}, /* à */
593 {'a', '\'', 225}, /* á */
594 {'a', '^', 226}, /* â */
595 {'a', '~', 227}, /* ã */
596 {'a', '"', 228}, /* ä */
597 {'a', '@', 229}, /* å */
598 {'a', 'a', 229}, /* å */
599 {'a', 'e', 230}, /* æ */
600 {'c', ',', 231}, /* ç */
601 {'e', '`', 232}, /* è */
602 {'e', '\'', 233}, /* é */
603 {'e', '^', 234}, /* ê */
604 {'e', '"', 235}, /* ë */
605 {'i', '`', 236}, /* ì */
606 {'i', '\'', 237}, /* í */
607 {'i', '^', 238}, /* î */
608 {'i', '"', 239}, /* ï */
609 {'d', '-', 240}, /* ð */
610 {'n', '~', 241}, /* ñ */
611 {'o', '`', 242}, /* ò */
612 {'o', '\'', 243}, /* ó */
613 {'o', '^', 244}, /* ô */
614 {'o', '~', 245}, /* õ */
615 {'o', '"', 246}, /* ö */
616 {':', '-', 247}, /* ÷ - division symbol in ISO 8859-1 */
617 {'o', 'e', 247}, /* ÷ - oe in ISO 8859-15 */
618 {'o', '/', 248}, /* ø */
619 {'u', '`', 249}, /* ù */
620 {'u', '\'', 250}, /* ú */
621 {'u', '^', 251}, /* û */
622 {'u', '"', 252}, /* ü */
623 {'y', '\'', 253}, /* ý */
624 {'i', 'p', 254}, /* þ */
625 {'y', '"', 255}, /* x XX */
626 {NUL, NUL, NUL}
628 # else /* OLD_DIGRAPHS */
631 * digraphs for Unicode from RFC1345
632 * (also work for ISO-8859-1 aka latin1)
635 {'N', 'U', 0x0a}, /* LF for NUL */
636 {'S', 'H', 0x01},
637 {'S', 'X', 0x02},
638 {'E', 'X', 0x03},
639 {'E', 'T', 0x04},
640 {'E', 'Q', 0x05},
641 {'A', 'K', 0x06},
642 {'B', 'L', 0x07},
643 {'B', 'S', 0x08},
644 {'H', 'T', 0x09},
645 {'L', 'F', 0x0a},
646 {'V', 'T', 0x0b},
647 {'F', 'F', 0x0c},
648 {'C', 'R', 0x0d},
649 {'S', 'O', 0x0e},
650 {'S', 'I', 0x0f},
651 {'D', 'L', 0x10},
652 {'D', '1', 0x11},
653 {'D', '2', 0x12},
654 {'D', '3', 0x13},
655 {'D', '4', 0x14},
656 {'N', 'K', 0x15},
657 {'S', 'Y', 0x16},
658 {'E', 'B', 0x17},
659 {'C', 'N', 0x18},
660 {'E', 'M', 0x19},
661 {'S', 'B', 0x1a},
662 {'E', 'C', 0x1b},
663 {'F', 'S', 0x1c},
664 {'G', 'S', 0x1d},
665 {'R', 'S', 0x1e},
666 {'U', 'S', 0x1f},
667 {'S', 'P', 0x20},
668 {'N', 'b', 0x23},
669 {'D', 'O', 0x24},
670 {'A', 't', 0x40},
671 {'<', '(', 0x5b},
672 {'/', '/', 0x5c},
673 {')', '>', 0x5d},
674 {'\'', '>', 0x5e},
675 {'\'', '!', 0x60},
676 {'(', '!', 0x7b},
677 {'!', '!', 0x7c},
678 {'!', ')', 0x7d},
679 {'\'', '?', 0x7e},
680 {'D', 'T', 0x7f},
681 {'P', 'A', 0x80},
682 {'H', 'O', 0x81},
683 {'B', 'H', 0x82},
684 {'N', 'H', 0x83},
685 {'I', 'N', 0x84},
686 {'N', 'L', 0x85},
687 {'S', 'A', 0x86},
688 {'E', 'S', 0x87},
689 {'H', 'S', 0x88},
690 {'H', 'J', 0x89},
691 {'V', 'S', 0x8a},
692 {'P', 'D', 0x8b},
693 {'P', 'U', 0x8c},
694 {'R', 'I', 0x8d},
695 {'S', '2', 0x8e},
696 {'S', '3', 0x8f},
697 {'D', 'C', 0x90},
698 {'P', '1', 0x91},
699 {'P', '2', 0x92},
700 {'T', 'S', 0x93},
701 {'C', 'C', 0x94},
702 {'M', 'W', 0x95},
703 {'S', 'G', 0x96},
704 {'E', 'G', 0x97},
705 {'S', 'S', 0x98},
706 {'G', 'C', 0x99},
707 {'S', 'C', 0x9a},
708 {'C', 'I', 0x9b},
709 {'S', 'T', 0x9c},
710 {'O', 'C', 0x9d},
711 {'P', 'M', 0x9e},
712 {'A', 'C', 0x9f},
713 {'N', 'S', 0xa0},
714 {'!', 'I', 0xa1},
715 {'C', 't', 0xa2},
716 {'P', 'd', 0xa3},
717 {'C', 'u', 0xa4},
718 {'Y', 'e', 0xa5},
719 {'B', 'B', 0xa6},
720 {'S', 'E', 0xa7},
721 {'\'', ':', 0xa8},
722 {'C', 'o', 0xa9},
723 {'-', 'a', 0xaa},
724 {'<', '<', 0xab},
725 {'N', 'O', 0xac},
726 {'-', '-', 0xad},
727 {'R', 'g', 0xae},
728 {'\'', 'm', 0xaf},
729 {'D', 'G', 0xb0},
730 {'+', '-', 0xb1},
731 {'2', 'S', 0xb2},
732 {'3', 'S', 0xb3},
733 {'\'', '\'', 0xb4},
734 {'M', 'y', 0xb5},
735 {'P', 'I', 0xb6},
736 {'.', 'M', 0xb7},
737 {'\'', ',', 0xb8},
738 {'1', 'S', 0xb9},
739 {'-', 'o', 0xba},
740 {'>', '>', 0xbb},
741 {'1', '4', 0xbc},
742 {'1', '2', 0xbd},
743 {'3', '4', 0xbe},
744 {'?', 'I', 0xbf},
745 {'A', '!', 0xc0},
746 {'A', '\'', 0xc1},
747 {'A', '>', 0xc2},
748 {'A', '?', 0xc3},
749 {'A', ':', 0xc4},
750 {'A', 'A', 0xc5},
751 {'A', 'E', 0xc6},
752 {'C', ',', 0xc7},
753 {'E', '!', 0xc8},
754 {'E', '\'', 0xc9},
755 {'E', '>', 0xca},
756 {'E', ':', 0xcb},
757 {'I', '!', 0xcc},
758 {'I', '\'', 0xcd},
759 {'I', '>', 0xce},
760 {'I', ':', 0xcf},
761 {'D', '-', 0xd0},
762 {'N', '?', 0xd1},
763 {'O', '!', 0xd2},
764 {'O', '\'', 0xd3},
765 {'O', '>', 0xd4},
766 {'O', '?', 0xd5},
767 {'O', ':', 0xd6},
768 {'*', 'X', 0xd7},
769 {'O', '/', 0xd8},
770 {'U', '!', 0xd9},
771 {'U', '\'', 0xda},
772 {'U', '>', 0xdb},
773 {'U', ':', 0xdc},
774 {'Y', '\'', 0xdd},
775 {'T', 'H', 0xde},
776 {'s', 's', 0xdf},
777 {'a', '!', 0xe0},
778 {'a', '\'', 0xe1},
779 {'a', '>', 0xe2},
780 {'a', '?', 0xe3},
781 {'a', ':', 0xe4},
782 {'a', 'a', 0xe5},
783 {'a', 'e', 0xe6},
784 {'c', ',', 0xe7},
785 {'e', '!', 0xe8},
786 {'e', '\'', 0xe9},
787 {'e', '>', 0xea},
788 {'e', ':', 0xeb},
789 {'i', '!', 0xec},
790 {'i', '\'', 0xed},
791 {'i', '>', 0xee},
792 {'i', ':', 0xef},
793 {'d', '-', 0xf0},
794 {'n', '?', 0xf1},
795 {'o', '!', 0xf2},
796 {'o', '\'', 0xf3},
797 {'o', '>', 0xf4},
798 {'o', '?', 0xf5},
799 {'o', ':', 0xf6},
800 {'-', ':', 0xf7},
801 {'o', '/', 0xf8},
802 {'u', '!', 0xf9},
803 {'u', '\'', 0xfa},
804 {'u', '>', 0xfb},
805 {'u', ':', 0xfc},
806 {'y', '\'', 0xfd},
807 {'t', 'h', 0xfe},
808 {'y', ':', 0xff},
810 # ifdef FEAT_MBYTE
811 # define USE_UNICODE_DIGRAPHS
813 {'A', '-', 0x0100},
814 {'a', '-', 0x0101},
815 {'A', '(', 0x0102},
816 {'a', '(', 0x0103},
817 {'A', ';', 0x0104},
818 {'a', ';', 0x0105},
819 {'C', '\'', 0x0106},
820 {'c', '\'', 0x0107},
821 {'C', '>', 0x0108},
822 {'c', '>', 0x0109},
823 {'C', '.', 0x010a},
824 {'c', '.', 0x010b},
825 {'C', '<', 0x010c},
826 {'c', '<', 0x010d},
827 {'D', '<', 0x010e},
828 {'d', '<', 0x010f},
829 {'D', '/', 0x0110},
830 {'d', '/', 0x0111},
831 {'E', '-', 0x0112},
832 {'e', '-', 0x0113},
833 {'E', '(', 0x0114},
834 {'e', '(', 0x0115},
835 {'E', '.', 0x0116},
836 {'e', '.', 0x0117},
837 {'E', ';', 0x0118},
838 {'e', ';', 0x0119},
839 {'E', '<', 0x011a},
840 {'e', '<', 0x011b},
841 {'G', '>', 0x011c},
842 {'g', '>', 0x011d},
843 {'G', '(', 0x011e},
844 {'g', '(', 0x011f},
845 {'G', '.', 0x0120},
846 {'g', '.', 0x0121},
847 {'G', ',', 0x0122},
848 {'g', ',', 0x0123},
849 {'H', '>', 0x0124},
850 {'h', '>', 0x0125},
851 {'H', '/', 0x0126},
852 {'h', '/', 0x0127},
853 {'I', '?', 0x0128},
854 {'i', '?', 0x0129},
855 {'I', '-', 0x012a},
856 {'i', '-', 0x012b},
857 {'I', '(', 0x012c},
858 {'i', '(', 0x012d},
859 {'I', ';', 0x012e},
860 {'i', ';', 0x012f},
861 {'I', '.', 0x0130},
862 {'i', '.', 0x0131},
863 {'I', 'J', 0x0132},
864 {'i', 'j', 0x0133},
865 {'J', '>', 0x0134},
866 {'j', '>', 0x0135},
867 {'K', ',', 0x0136},
868 {'k', ',', 0x0137},
869 {'k', 'k', 0x0138},
870 {'L', '\'', 0x0139},
871 {'l', '\'', 0x013a},
872 {'L', ',', 0x013b},
873 {'l', ',', 0x013c},
874 {'L', '<', 0x013d},
875 {'l', '<', 0x013e},
876 {'L', '.', 0x013f},
877 {'l', '.', 0x0140},
878 {'L', '/', 0x0141},
879 {'l', '/', 0x0142},
880 {'N', '\'', 0x0143},
881 {'n', '\'', 0x0144},
882 {'N', ',', 0x0145},
883 {'n', ',', 0x0146},
884 {'N', '<', 0x0147},
885 {'n', '<', 0x0148},
886 {'\'', 'n', 0x0149},
887 {'N', 'G', 0x014a},
888 {'n', 'g', 0x014b},
889 {'O', '-', 0x014c},
890 {'o', '-', 0x014d},
891 {'O', '(', 0x014e},
892 {'o', '(', 0x014f},
893 {'O', '"', 0x0150},
894 {'o', '"', 0x0151},
895 {'O', 'E', 0x0152},
896 {'o', 'e', 0x0153},
897 {'R', '\'', 0x0154},
898 {'r', '\'', 0x0155},
899 {'R', ',', 0x0156},
900 {'r', ',', 0x0157},
901 {'R', '<', 0x0158},
902 {'r', '<', 0x0159},
903 {'S', '\'', 0x015a},
904 {'s', '\'', 0x015b},
905 {'S', '>', 0x015c},
906 {'s', '>', 0x015d},
907 {'S', ',', 0x015e},
908 {'s', ',', 0x015f},
909 {'S', '<', 0x0160},
910 {'s', '<', 0x0161},
911 {'T', ',', 0x0162},
912 {'t', ',', 0x0163},
913 {'T', '<', 0x0164},
914 {'t', '<', 0x0165},
915 {'T', '/', 0x0166},
916 {'t', '/', 0x0167},
917 {'U', '?', 0x0168},
918 {'u', '?', 0x0169},
919 {'U', '-', 0x016a},
920 {'u', '-', 0x016b},
921 {'U', '(', 0x016c},
922 {'u', '(', 0x016d},
923 {'U', '0', 0x016e},
924 {'u', '0', 0x016f},
925 {'U', '"', 0x0170},
926 {'u', '"', 0x0171},
927 {'U', ';', 0x0172},
928 {'u', ';', 0x0173},
929 {'W', '>', 0x0174},
930 {'w', '>', 0x0175},
931 {'Y', '>', 0x0176},
932 {'y', '>', 0x0177},
933 {'Y', ':', 0x0178},
934 {'Z', '\'', 0x0179},
935 {'z', '\'', 0x017a},
936 {'Z', '.', 0x017b},
937 {'z', '.', 0x017c},
938 {'Z', '<', 0x017d},
939 {'z', '<', 0x017e},
940 {'O', '9', 0x01a0},
941 {'o', '9', 0x01a1},
942 {'O', 'I', 0x01a2},
943 {'o', 'i', 0x01a3},
944 {'y', 'r', 0x01a6},
945 {'U', '9', 0x01af},
946 {'u', '9', 0x01b0},
947 {'Z', '/', 0x01b5},
948 {'z', '/', 0x01b6},
949 {'E', 'D', 0x01b7},
950 {'A', '<', 0x01cd},
951 {'a', '<', 0x01ce},
952 {'I', '<', 0x01cf},
953 {'i', '<', 0x01d0},
954 {'O', '<', 0x01d1},
955 {'o', '<', 0x01d2},
956 {'U', '<', 0x01d3},
957 {'u', '<', 0x01d4},
958 {'A', '1', 0x01de},
959 {'a', '1', 0x01df},
960 {'A', '7', 0x01e0},
961 {'a', '7', 0x01e1},
962 {'A', '3', 0x01e2},
963 {'a', '3', 0x01e3},
964 {'G', '/', 0x01e4},
965 {'g', '/', 0x01e5},
966 {'G', '<', 0x01e6},
967 {'g', '<', 0x01e7},
968 {'K', '<', 0x01e8},
969 {'k', '<', 0x01e9},
970 {'O', ';', 0x01ea},
971 {'o', ';', 0x01eb},
972 {'O', '1', 0x01ec},
973 {'o', '1', 0x01ed},
974 {'E', 'Z', 0x01ee},
975 {'e', 'z', 0x01ef},
976 {'j', '<', 0x01f0},
977 {'G', '\'', 0x01f4},
978 {'g', '\'', 0x01f5},
979 {';', 'S', 0x02bf},
980 {'\'', '<', 0x02c7},
981 {'\'', '(', 0x02d8},
982 {'\'', '.', 0x02d9},
983 {'\'', '0', 0x02da},
984 {'\'', ';', 0x02db},
985 {'\'', '"', 0x02dd},
986 {'A', '%', 0x0386},
987 {'E', '%', 0x0388},
988 {'Y', '%', 0x0389},
989 {'I', '%', 0x038a},
990 {'O', '%', 0x038c},
991 {'U', '%', 0x038e},
992 {'W', '%', 0x038f},
993 {'i', '3', 0x0390},
994 {'A', '*', 0x0391},
995 {'B', '*', 0x0392},
996 {'G', '*', 0x0393},
997 {'D', '*', 0x0394},
998 {'E', '*', 0x0395},
999 {'Z', '*', 0x0396},
1000 {'Y', '*', 0x0397},
1001 {'H', '*', 0x0398},
1002 {'I', '*', 0x0399},
1003 {'K', '*', 0x039a},
1004 {'L', '*', 0x039b},
1005 {'M', '*', 0x039c},
1006 {'N', '*', 0x039d},
1007 {'C', '*', 0x039e},
1008 {'O', '*', 0x039f},
1009 {'P', '*', 0x03a0},
1010 {'R', '*', 0x03a1},
1011 {'S', '*', 0x03a3},
1012 {'T', '*', 0x03a4},
1013 {'U', '*', 0x03a5},
1014 {'F', '*', 0x03a6},
1015 {'X', '*', 0x03a7},
1016 {'Q', '*', 0x03a8},
1017 {'W', '*', 0x03a9},
1018 {'J', '*', 0x03aa},
1019 {'V', '*', 0x03ab},
1020 {'a', '%', 0x03ac},
1021 {'e', '%', 0x03ad},
1022 {'y', '%', 0x03ae},
1023 {'i', '%', 0x03af},
1024 {'u', '3', 0x03b0},
1025 {'a', '*', 0x03b1},
1026 {'b', '*', 0x03b2},
1027 {'g', '*', 0x03b3},
1028 {'d', '*', 0x03b4},
1029 {'e', '*', 0x03b5},
1030 {'z', '*', 0x03b6},
1031 {'y', '*', 0x03b7},
1032 {'h', '*', 0x03b8},
1033 {'i', '*', 0x03b9},
1034 {'k', '*', 0x03ba},
1035 {'l', '*', 0x03bb},
1036 {'m', '*', 0x03bc},
1037 {'n', '*', 0x03bd},
1038 {'c', '*', 0x03be},
1039 {'o', '*', 0x03bf},
1040 {'p', '*', 0x03c0},
1041 {'r', '*', 0x03c1},
1042 {'*', 's', 0x03c2},
1043 {'s', '*', 0x03c3},
1044 {'t', '*', 0x03c4},
1045 {'u', '*', 0x03c5},
1046 {'f', '*', 0x03c6},
1047 {'x', '*', 0x03c7},
1048 {'q', '*', 0x03c8},
1049 {'w', '*', 0x03c9},
1050 {'j', '*', 0x03ca},
1051 {'v', '*', 0x03cb},
1052 {'o', '%', 0x03cc},
1053 {'u', '%', 0x03cd},
1054 {'w', '%', 0x03ce},
1055 {'\'', 'G', 0x03d8},
1056 {',', 'G', 0x03d9},
1057 {'T', '3', 0x03da},
1058 {'t', '3', 0x03db},
1059 {'M', '3', 0x03dc},
1060 {'m', '3', 0x03dd},
1061 {'K', '3', 0x03de},
1062 {'k', '3', 0x03df},
1063 {'P', '3', 0x03e0},
1064 {'p', '3', 0x03e1},
1065 {'\'', '%', 0x03f4},
1066 {'j', '3', 0x03f5},
1067 {'I', 'O', 0x0401},
1068 {'D', '%', 0x0402},
1069 {'G', '%', 0x0403},
1070 {'I', 'E', 0x0404},
1071 {'D', 'S', 0x0405},
1072 {'I', 'I', 0x0406},
1073 {'Y', 'I', 0x0407},
1074 {'J', '%', 0x0408},
1075 {'L', 'J', 0x0409},
1076 {'N', 'J', 0x040a},
1077 {'T', 's', 0x040b},
1078 {'K', 'J', 0x040c},
1079 {'V', '%', 0x040e},
1080 {'D', 'Z', 0x040f},
1081 {'A', '=', 0x0410},
1082 {'B', '=', 0x0411},
1083 {'V', '=', 0x0412},
1084 {'G', '=', 0x0413},
1085 {'D', '=', 0x0414},
1086 {'E', '=', 0x0415},
1087 {'Z', '%', 0x0416},
1088 {'Z', '=', 0x0417},
1089 {'I', '=', 0x0418},
1090 {'J', '=', 0x0419},
1091 {'K', '=', 0x041a},
1092 {'L', '=', 0x041b},
1093 {'M', '=', 0x041c},
1094 {'N', '=', 0x041d},
1095 {'O', '=', 0x041e},
1096 {'P', '=', 0x041f},
1097 {'R', '=', 0x0420},
1098 {'S', '=', 0x0421},
1099 {'T', '=', 0x0422},
1100 {'U', '=', 0x0423},
1101 {'F', '=', 0x0424},
1102 {'H', '=', 0x0425},
1103 {'C', '=', 0x0426},
1104 {'C', '%', 0x0427},
1105 {'S', '%', 0x0428},
1106 {'S', 'c', 0x0429},
1107 {'=', '"', 0x042a},
1108 {'Y', '=', 0x042b},
1109 {'%', '"', 0x042c},
1110 {'J', 'E', 0x042d},
1111 {'J', 'U', 0x042e},
1112 {'J', 'A', 0x042f},
1113 {'a', '=', 0x0430},
1114 {'b', '=', 0x0431},
1115 {'v', '=', 0x0432},
1116 {'g', '=', 0x0433},
1117 {'d', '=', 0x0434},
1118 {'e', '=', 0x0435},
1119 {'z', '%', 0x0436},
1120 {'z', '=', 0x0437},
1121 {'i', '=', 0x0438},
1122 {'j', '=', 0x0439},
1123 {'k', '=', 0x043a},
1124 {'l', '=', 0x043b},
1125 {'m', '=', 0x043c},
1126 {'n', '=', 0x043d},
1127 {'o', '=', 0x043e},
1128 {'p', '=', 0x043f},
1129 {'r', '=', 0x0440},
1130 {'s', '=', 0x0441},
1131 {'t', '=', 0x0442},
1132 {'u', '=', 0x0443},
1133 {'f', '=', 0x0444},
1134 {'h', '=', 0x0445},
1135 {'c', '=', 0x0446},
1136 {'c', '%', 0x0447},
1137 {'s', '%', 0x0448},
1138 {'s', 'c', 0x0449},
1139 {'=', '\'', 0x044a},
1140 {'y', '=', 0x044b},
1141 {'%', '\'', 0x044c},
1142 {'j', 'e', 0x044d},
1143 {'j', 'u', 0x044e},
1144 {'j', 'a', 0x044f},
1145 {'i', 'o', 0x0451},
1146 {'d', '%', 0x0452},
1147 {'g', '%', 0x0453},
1148 {'i', 'e', 0x0454},
1149 {'d', 's', 0x0455},
1150 {'i', 'i', 0x0456},
1151 {'y', 'i', 0x0457},
1152 {'j', '%', 0x0458},
1153 {'l', 'j', 0x0459},
1154 {'n', 'j', 0x045a},
1155 {'t', 's', 0x045b},
1156 {'k', 'j', 0x045c},
1157 {'v', '%', 0x045e},
1158 {'d', 'z', 0x045f},
1159 {'Y', '3', 0x0462},
1160 {'y', '3', 0x0463},
1161 {'O', '3', 0x046a},
1162 {'o', '3', 0x046b},
1163 {'F', '3', 0x0472},
1164 {'f', '3', 0x0473},
1165 {'V', '3', 0x0474},
1166 {'v', '3', 0x0475},
1167 {'C', '3', 0x0480},
1168 {'c', '3', 0x0481},
1169 {'G', '3', 0x0490},
1170 {'g', '3', 0x0491},
1171 {'A', '+', 0x05d0},
1172 {'B', '+', 0x05d1},
1173 {'G', '+', 0x05d2},
1174 {'D', '+', 0x05d3},
1175 {'H', '+', 0x05d4},
1176 {'W', '+', 0x05d5},
1177 {'Z', '+', 0x05d6},
1178 {'X', '+', 0x05d7},
1179 {'T', 'j', 0x05d8},
1180 {'J', '+', 0x05d9},
1181 {'K', '%', 0x05da},
1182 {'K', '+', 0x05db},
1183 {'L', '+', 0x05dc},
1184 {'M', '%', 0x05dd},
1185 {'M', '+', 0x05de},
1186 {'N', '%', 0x05df},
1187 {'N', '+', 0x05e0},
1188 {'S', '+', 0x05e1},
1189 {'E', '+', 0x05e2},
1190 {'P', '%', 0x05e3},
1191 {'P', '+', 0x05e4},
1192 {'Z', 'j', 0x05e5},
1193 {'Z', 'J', 0x05e6},
1194 {'Q', '+', 0x05e7},
1195 {'R', '+', 0x05e8},
1196 {'S', 'h', 0x05e9},
1197 {'T', '+', 0x05ea},
1198 {',', '+', 0x060c},
1199 {';', '+', 0x061b},
1200 {'?', '+', 0x061f},
1201 {'H', '\'', 0x0621},
1202 {'a', 'M', 0x0622},
1203 {'a', 'H', 0x0623},
1204 {'w', 'H', 0x0624},
1205 {'a', 'h', 0x0625},
1206 {'y', 'H', 0x0626},
1207 {'a', '+', 0x0627},
1208 {'b', '+', 0x0628},
1209 {'t', 'm', 0x0629},
1210 {'t', '+', 0x062a},
1211 {'t', 'k', 0x062b},
1212 {'g', '+', 0x062c},
1213 {'h', 'k', 0x062d},
1214 {'x', '+', 0x062e},
1215 {'d', '+', 0x062f},
1216 {'d', 'k', 0x0630},
1217 {'r', '+', 0x0631},
1218 {'z', '+', 0x0632},
1219 {'s', '+', 0x0633},
1220 {'s', 'n', 0x0634},
1221 {'c', '+', 0x0635},
1222 {'d', 'd', 0x0636},
1223 {'t', 'j', 0x0637},
1224 {'z', 'H', 0x0638},
1225 {'e', '+', 0x0639},
1226 {'i', '+', 0x063a},
1227 {'+', '+', 0x0640},
1228 {'f', '+', 0x0641},
1229 {'q', '+', 0x0642},
1230 {'k', '+', 0x0643},
1231 {'l', '+', 0x0644},
1232 {'m', '+', 0x0645},
1233 {'n', '+', 0x0646},
1234 {'h', '+', 0x0647},
1235 {'w', '+', 0x0648},
1236 {'j', '+', 0x0649},
1237 {'y', '+', 0x064a},
1238 {':', '+', 0x064b},
1239 {'"', '+', 0x064c},
1240 {'=', '+', 0x064d},
1241 {'/', '+', 0x064e},
1242 {'\'', '+', 0x064f},
1243 {'1', '+', 0x0650},
1244 {'3', '+', 0x0651},
1245 {'0', '+', 0x0652},
1246 {'a', 'S', 0x0670},
1247 {'p', '+', 0x067e},
1248 {'v', '+', 0x06a4},
1249 {'g', 'f', 0x06af},
1250 {'0', 'a', 0x06f0},
1251 {'1', 'a', 0x06f1},
1252 {'2', 'a', 0x06f2},
1253 {'3', 'a', 0x06f3},
1254 {'4', 'a', 0x06f4},
1255 {'5', 'a', 0x06f5},
1256 {'6', 'a', 0x06f6},
1257 {'7', 'a', 0x06f7},
1258 {'8', 'a', 0x06f8},
1259 {'9', 'a', 0x06f9},
1260 {'B', '.', 0x1e02},
1261 {'b', '.', 0x1e03},
1262 {'B', '_', 0x1e06},
1263 {'b', '_', 0x1e07},
1264 {'D', '.', 0x1e0a},
1265 {'d', '.', 0x1e0b},
1266 {'D', '_', 0x1e0e},
1267 {'d', '_', 0x1e0f},
1268 {'D', ',', 0x1e10},
1269 {'d', ',', 0x1e11},
1270 {'F', '.', 0x1e1e},
1271 {'f', '.', 0x1e1f},
1272 {'G', '-', 0x1e20},
1273 {'g', '-', 0x1e21},
1274 {'H', '.', 0x1e22},
1275 {'h', '.', 0x1e23},
1276 {'H', ':', 0x1e26},
1277 {'h', ':', 0x1e27},
1278 {'H', ',', 0x1e28},
1279 {'h', ',', 0x1e29},
1280 {'K', '\'', 0x1e30},
1281 {'k', '\'', 0x1e31},
1282 {'K', '_', 0x1e34},
1283 {'k', '_', 0x1e35},
1284 {'L', '_', 0x1e3a},
1285 {'l', '_', 0x1e3b},
1286 {'M', '\'', 0x1e3e},
1287 {'m', '\'', 0x1e3f},
1288 {'M', '.', 0x1e40},
1289 {'m', '.', 0x1e41},
1290 {'N', '.', 0x1e44},
1291 {'n', '.', 0x1e45},
1292 {'N', '_', 0x1e48},
1293 {'n', '_', 0x1e49},
1294 {'P', '\'', 0x1e54},
1295 {'p', '\'', 0x1e55},
1296 {'P', '.', 0x1e56},
1297 {'p', '.', 0x1e57},
1298 {'R', '.', 0x1e58},
1299 {'r', '.', 0x1e59},
1300 {'R', '_', 0x1e5e},
1301 {'r', '_', 0x1e5f},
1302 {'S', '.', 0x1e60},
1303 {'s', '.', 0x1e61},
1304 {'T', '.', 0x1e6a},
1305 {'t', '.', 0x1e6b},
1306 {'T', '_', 0x1e6e},
1307 {'t', '_', 0x1e6f},
1308 {'V', '?', 0x1e7c},
1309 {'v', '?', 0x1e7d},
1310 {'W', '!', 0x1e80},
1311 {'w', '!', 0x1e81},
1312 {'W', '\'', 0x1e82},
1313 {'w', '\'', 0x1e83},
1314 {'W', ':', 0x1e84},
1315 {'w', ':', 0x1e85},
1316 {'W', '.', 0x1e86},
1317 {'w', '.', 0x1e87},
1318 {'X', '.', 0x1e8a},
1319 {'x', '.', 0x1e8b},
1320 {'X', ':', 0x1e8c},
1321 {'x', ':', 0x1e8d},
1322 {'Y', '.', 0x1e8e},
1323 {'y', '.', 0x1e8f},
1324 {'Z', '>', 0x1e90},
1325 {'z', '>', 0x1e91},
1326 {'Z', '_', 0x1e94},
1327 {'z', '_', 0x1e95},
1328 {'h', '_', 0x1e96},
1329 {'t', ':', 0x1e97},
1330 {'w', '0', 0x1e98},
1331 {'y', '0', 0x1e99},
1332 {'A', '2', 0x1ea2},
1333 {'a', '2', 0x1ea3},
1334 {'E', '2', 0x1eba},
1335 {'e', '2', 0x1ebb},
1336 {'E', '?', 0x1ebc},
1337 {'e', '?', 0x1ebd},
1338 {'I', '2', 0x1ec8},
1339 {'i', '2', 0x1ec9},
1340 {'O', '2', 0x1ece},
1341 {'o', '2', 0x1ecf},
1342 {'U', '2', 0x1ee6},
1343 {'u', '2', 0x1ee7},
1344 {'Y', '!', 0x1ef2},
1345 {'y', '!', 0x1ef3},
1346 {'Y', '2', 0x1ef6},
1347 {'y', '2', 0x1ef7},
1348 {'Y', '?', 0x1ef8},
1349 {'y', '?', 0x1ef9},
1350 {';', '\'', 0x1f00},
1351 {',', '\'', 0x1f01},
1352 {';', '!', 0x1f02},
1353 {',', '!', 0x1f03},
1354 {'?', ';', 0x1f04},
1355 {'?', ',', 0x1f05},
1356 {'!', ':', 0x1f06},
1357 {'?', ':', 0x1f07},
1358 {'1', 'N', 0x2002},
1359 {'1', 'M', 0x2003},
1360 {'3', 'M', 0x2004},
1361 {'4', 'M', 0x2005},
1362 {'6', 'M', 0x2006},
1363 {'1', 'T', 0x2009},
1364 {'1', 'H', 0x200a},
1365 {'-', '1', 0x2010},
1366 {'-', 'N', 0x2013},
1367 {'-', 'M', 0x2014},
1368 {'-', '3', 0x2015},
1369 {'!', '2', 0x2016},
1370 {'=', '2', 0x2017},
1371 {'\'', '6', 0x2018},
1372 {'\'', '9', 0x2019},
1373 {'.', '9', 0x201a},
1374 {'9', '\'', 0x201b},
1375 {'"', '6', 0x201c},
1376 {'"', '9', 0x201d},
1377 {':', '9', 0x201e},
1378 {'9', '"', 0x201f},
1379 {'/', '-', 0x2020},
1380 {'/', '=', 0x2021},
1381 {'.', '.', 0x2025},
1382 {'%', '0', 0x2030},
1383 {'1', '\'', 0x2032},
1384 {'2', '\'', 0x2033},
1385 {'3', '\'', 0x2034},
1386 {'1', '"', 0x2035},
1387 {'2', '"', 0x2036},
1388 {'3', '"', 0x2037},
1389 {'C', 'a', 0x2038},
1390 {'<', '1', 0x2039},
1391 {'>', '1', 0x203a},
1392 {':', 'X', 0x203b},
1393 {'\'', '-', 0x203e},
1394 {'/', 'f', 0x2044},
1395 {'0', 'S', 0x2070},
1396 {'4', 'S', 0x2074},
1397 {'5', 'S', 0x2075},
1398 {'6', 'S', 0x2076},
1399 {'7', 'S', 0x2077},
1400 {'8', 'S', 0x2078},
1401 {'9', 'S', 0x2079},
1402 {'+', 'S', 0x207a},
1403 {'-', 'S', 0x207b},
1404 {'=', 'S', 0x207c},
1405 {'(', 'S', 0x207d},
1406 {')', 'S', 0x207e},
1407 {'n', 'S', 0x207f},
1408 {'0', 's', 0x2080},
1409 {'1', 's', 0x2081},
1410 {'2', 's', 0x2082},
1411 {'3', 's', 0x2083},
1412 {'4', 's', 0x2084},
1413 {'5', 's', 0x2085},
1414 {'6', 's', 0x2086},
1415 {'7', 's', 0x2087},
1416 {'8', 's', 0x2088},
1417 {'9', 's', 0x2089},
1418 {'+', 's', 0x208a},
1419 {'-', 's', 0x208b},
1420 {'=', 's', 0x208c},
1421 {'(', 's', 0x208d},
1422 {')', 's', 0x208e},
1423 {'L', 'i', 0x20a4},
1424 {'P', 't', 0x20a7},
1425 {'W', '=', 0x20a9},
1426 {'=', 'e', 0x20ac}, /* euro */
1427 {'E', 'u', 0x20ac}, /* euro */
1428 {'o', 'C', 0x2103},
1429 {'c', 'o', 0x2105},
1430 {'o', 'F', 0x2109},
1431 {'N', '0', 0x2116},
1432 {'P', 'O', 0x2117},
1433 {'R', 'x', 0x211e},
1434 {'S', 'M', 0x2120},
1435 {'T', 'M', 0x2122},
1436 {'O', 'm', 0x2126},
1437 {'A', 'O', 0x212b},
1438 {'1', '3', 0x2153},
1439 {'2', '3', 0x2154},
1440 {'1', '5', 0x2155},
1441 {'2', '5', 0x2156},
1442 {'3', '5', 0x2157},
1443 {'4', '5', 0x2158},
1444 {'1', '6', 0x2159},
1445 {'5', '6', 0x215a},
1446 {'1', '8', 0x215b},
1447 {'3', '8', 0x215c},
1448 {'5', '8', 0x215d},
1449 {'7', '8', 0x215e},
1450 {'1', 'R', 0x2160},
1451 {'2', 'R', 0x2161},
1452 {'3', 'R', 0x2162},
1453 {'4', 'R', 0x2163},
1454 {'5', 'R', 0x2164},
1455 {'6', 'R', 0x2165},
1456 {'7', 'R', 0x2166},
1457 {'8', 'R', 0x2167},
1458 {'9', 'R', 0x2168},
1459 {'a', 'R', 0x2169},
1460 {'b', 'R', 0x216a},
1461 {'c', 'R', 0x216b},
1462 {'1', 'r', 0x2170},
1463 {'2', 'r', 0x2171},
1464 {'3', 'r', 0x2172},
1465 {'4', 'r', 0x2173},
1466 {'5', 'r', 0x2174},
1467 {'6', 'r', 0x2175},
1468 {'7', 'r', 0x2176},
1469 {'8', 'r', 0x2177},
1470 {'9', 'r', 0x2178},
1471 {'a', 'r', 0x2179},
1472 {'b', 'r', 0x217a},
1473 {'c', 'r', 0x217b},
1474 {'<', '-', 0x2190},
1475 {'-', '!', 0x2191},
1476 {'-', '>', 0x2192},
1477 {'-', 'v', 0x2193},
1478 {'<', '>', 0x2194},
1479 {'U', 'D', 0x2195},
1480 {'<', '=', 0x21d0},
1481 {'=', '>', 0x21d2},
1482 {'=', '=', 0x21d4},
1483 {'F', 'A', 0x2200},
1484 {'d', 'P', 0x2202},
1485 {'T', 'E', 0x2203},
1486 {'/', '0', 0x2205},
1487 {'D', 'E', 0x2206},
1488 {'N', 'B', 0x2207},
1489 {'(', '-', 0x2208},
1490 {'-', ')', 0x220b},
1491 {'*', 'P', 0x220f},
1492 {'+', 'Z', 0x2211},
1493 {'-', '2', 0x2212},
1494 {'-', '+', 0x2213},
1495 {'*', '-', 0x2217},
1496 {'O', 'b', 0x2218},
1497 {'S', 'b', 0x2219},
1498 {'R', 'T', 0x221a},
1499 {'0', '(', 0x221d},
1500 {'0', '0', 0x221e},
1501 {'-', 'L', 0x221f},
1502 {'-', 'V', 0x2220},
1503 {'P', 'P', 0x2225},
1504 {'A', 'N', 0x2227},
1505 {'O', 'R', 0x2228},
1506 {'(', 'U', 0x2229},
1507 {')', 'U', 0x222a},
1508 {'I', 'n', 0x222b},
1509 {'D', 'I', 0x222c},
1510 {'I', 'o', 0x222e},
1511 {'.', ':', 0x2234},
1512 {':', '.', 0x2235},
1513 {':', 'R', 0x2236},
1514 {':', ':', 0x2237},
1515 {'?', '1', 0x223c},
1516 {'C', 'G', 0x223e},
1517 {'?', '-', 0x2243},
1518 {'?', '=', 0x2245},
1519 {'?', '2', 0x2248},
1520 {'=', '?', 0x224c},
1521 {'H', 'I', 0x2253},
1522 {'!', '=', 0x2260},
1523 {'=', '3', 0x2261},
1524 {'=', '<', 0x2264},
1525 {'>', '=', 0x2265},
1526 {'<', '*', 0x226a},
1527 {'*', '>', 0x226b},
1528 {'!', '<', 0x226e},
1529 {'!', '>', 0x226f},
1530 {'(', 'C', 0x2282},
1531 {')', 'C', 0x2283},
1532 {'(', '_', 0x2286},
1533 {')', '_', 0x2287},
1534 {'0', '.', 0x2299},
1535 {'0', '2', 0x229a},
1536 {'-', 'T', 0x22a5},
1537 {'.', 'P', 0x22c5},
1538 {':', '3', 0x22ee},
1539 {'.', '3', 0x22ef},
1540 {'E', 'h', 0x2302},
1541 {'<', '7', 0x2308},
1542 {'>', '7', 0x2309},
1543 {'7', '<', 0x230a},
1544 {'7', '>', 0x230b},
1545 {'N', 'I', 0x2310},
1546 {'(', 'A', 0x2312},
1547 {'T', 'R', 0x2315},
1548 {'I', 'u', 0x2320},
1549 {'I', 'l', 0x2321},
1550 {'<', '/', 0x2329},
1551 {'/', '>', 0x232a},
1552 {'V', 's', 0x2423},
1553 {'1', 'h', 0x2440},
1554 {'3', 'h', 0x2441},
1555 {'2', 'h', 0x2442},
1556 {'4', 'h', 0x2443},
1557 {'1', 'j', 0x2446},
1558 {'2', 'j', 0x2447},
1559 {'3', 'j', 0x2448},
1560 {'4', 'j', 0x2449},
1561 {'1', '.', 0x2488},
1562 {'2', '.', 0x2489},
1563 {'3', '.', 0x248a},
1564 {'4', '.', 0x248b},
1565 {'5', '.', 0x248c},
1566 {'6', '.', 0x248d},
1567 {'7', '.', 0x248e},
1568 {'8', '.', 0x248f},
1569 {'9', '.', 0x2490},
1570 {'h', 'h', 0x2500},
1571 {'H', 'H', 0x2501},
1572 {'v', 'v', 0x2502},
1573 {'V', 'V', 0x2503},
1574 {'3', '-', 0x2504},
1575 {'3', '_', 0x2505},
1576 {'3', '!', 0x2506},
1577 {'3', '/', 0x2507},
1578 {'4', '-', 0x2508},
1579 {'4', '_', 0x2509},
1580 {'4', '!', 0x250a},
1581 {'4', '/', 0x250b},
1582 {'d', 'r', 0x250c},
1583 {'d', 'R', 0x250d},
1584 {'D', 'r', 0x250e},
1585 {'D', 'R', 0x250f},
1586 {'d', 'l', 0x2510},
1587 {'d', 'L', 0x2511},
1588 {'D', 'l', 0x2512},
1589 {'L', 'D', 0x2513},
1590 {'u', 'r', 0x2514},
1591 {'u', 'R', 0x2515},
1592 {'U', 'r', 0x2516},
1593 {'U', 'R', 0x2517},
1594 {'u', 'l', 0x2518},
1595 {'u', 'L', 0x2519},
1596 {'U', 'l', 0x251a},
1597 {'U', 'L', 0x251b},
1598 {'v', 'r', 0x251c},
1599 {'v', 'R', 0x251d},
1600 {'V', 'r', 0x2520},
1601 {'V', 'R', 0x2523},
1602 {'v', 'l', 0x2524},
1603 {'v', 'L', 0x2525},
1604 {'V', 'l', 0x2528},
1605 {'V', 'L', 0x252b},
1606 {'d', 'h', 0x252c},
1607 {'d', 'H', 0x252f},
1608 {'D', 'h', 0x2530},
1609 {'D', 'H', 0x2533},
1610 {'u', 'h', 0x2534},
1611 {'u', 'H', 0x2537},
1612 {'U', 'h', 0x2538},
1613 {'U', 'H', 0x253b},
1614 {'v', 'h', 0x253c},
1615 {'v', 'H', 0x253f},
1616 {'V', 'h', 0x2542},
1617 {'V', 'H', 0x254b},
1618 {'F', 'D', 0x2571},
1619 {'B', 'D', 0x2572},
1620 {'T', 'B', 0x2580},
1621 {'L', 'B', 0x2584},
1622 {'F', 'B', 0x2588},
1623 {'l', 'B', 0x258c},
1624 {'R', 'B', 0x2590},
1625 {'.', 'S', 0x2591},
1626 {':', 'S', 0x2592},
1627 {'?', 'S', 0x2593},
1628 {'f', 'S', 0x25a0},
1629 {'O', 'S', 0x25a1},
1630 {'R', 'O', 0x25a2},
1631 {'R', 'r', 0x25a3},
1632 {'R', 'F', 0x25a4},
1633 {'R', 'Y', 0x25a5},
1634 {'R', 'H', 0x25a6},
1635 {'R', 'Z', 0x25a7},
1636 {'R', 'K', 0x25a8},
1637 {'R', 'X', 0x25a9},
1638 {'s', 'B', 0x25aa},
1639 {'S', 'R', 0x25ac},
1640 {'O', 'r', 0x25ad},
1641 {'U', 'T', 0x25b2},
1642 {'u', 'T', 0x25b3},
1643 {'P', 'R', 0x25b6},
1644 {'T', 'r', 0x25b7},
1645 {'D', 't', 0x25bc},
1646 {'d', 'T', 0x25bd},
1647 {'P', 'L', 0x25c0},
1648 {'T', 'l', 0x25c1},
1649 {'D', 'b', 0x25c6},
1650 {'D', 'w', 0x25c7},
1651 {'L', 'Z', 0x25ca},
1652 {'0', 'm', 0x25cb},
1653 {'0', 'o', 0x25ce},
1654 {'0', 'M', 0x25cf},
1655 {'0', 'L', 0x25d0},
1656 {'0', 'R', 0x25d1},
1657 {'S', 'n', 0x25d8},
1658 {'I', 'c', 0x25d9},
1659 {'F', 'd', 0x25e2},
1660 {'B', 'd', 0x25e3},
1661 {'*', '2', 0x2605},
1662 {'*', '1', 0x2606},
1663 {'<', 'H', 0x261c},
1664 {'>', 'H', 0x261e},
1665 {'0', 'u', 0x263a},
1666 {'0', 'U', 0x263b},
1667 {'S', 'U', 0x263c},
1668 {'F', 'm', 0x2640},
1669 {'M', 'l', 0x2642},
1670 {'c', 'S', 0x2660},
1671 {'c', 'H', 0x2661},
1672 {'c', 'D', 0x2662},
1673 {'c', 'C', 0x2663},
1674 {'M', 'd', 0x2669},
1675 {'M', '8', 0x266a},
1676 {'M', '2', 0x266b},
1677 {'M', 'b', 0x266d},
1678 {'M', 'x', 0x266e},
1679 {'M', 'X', 0x266f},
1680 {'O', 'K', 0x2713},
1681 {'X', 'X', 0x2717},
1682 {'-', 'X', 0x2720},
1683 {'I', 'S', 0x3000},
1684 {',', '_', 0x3001},
1685 {'.', '_', 0x3002},
1686 {'+', '"', 0x3003},
1687 {'+', '_', 0x3004},
1688 {'*', '_', 0x3005},
1689 {';', '_', 0x3006},
1690 {'0', '_', 0x3007},
1691 {'<', '+', 0x300a},
1692 {'>', '+', 0x300b},
1693 {'<', '\'', 0x300c},
1694 {'>', '\'', 0x300d},
1695 {'<', '"', 0x300e},
1696 {'>', '"', 0x300f},
1697 {'(', '"', 0x3010},
1698 {')', '"', 0x3011},
1699 {'=', 'T', 0x3012},
1700 {'=', '_', 0x3013},
1701 {'(', '\'', 0x3014},
1702 {')', '\'', 0x3015},
1703 {'(', 'I', 0x3016},
1704 {')', 'I', 0x3017},
1705 {'-', '?', 0x301c},
1706 {'A', '5', 0x3041},
1707 {'a', '5', 0x3042},
1708 {'I', '5', 0x3043},
1709 {'i', '5', 0x3044},
1710 {'U', '5', 0x3045},
1711 {'u', '5', 0x3046},
1712 {'E', '5', 0x3047},
1713 {'e', '5', 0x3048},
1714 {'O', '5', 0x3049},
1715 {'o', '5', 0x304a},
1716 {'k', 'a', 0x304b},
1717 {'g', 'a', 0x304c},
1718 {'k', 'i', 0x304d},
1719 {'g', 'i', 0x304e},
1720 {'k', 'u', 0x304f},
1721 {'g', 'u', 0x3050},
1722 {'k', 'e', 0x3051},
1723 {'g', 'e', 0x3052},
1724 {'k', 'o', 0x3053},
1725 {'g', 'o', 0x3054},
1726 {'s', 'a', 0x3055},
1727 {'z', 'a', 0x3056},
1728 {'s', 'i', 0x3057},
1729 {'z', 'i', 0x3058},
1730 {'s', 'u', 0x3059},
1731 {'z', 'u', 0x305a},
1732 {'s', 'e', 0x305b},
1733 {'z', 'e', 0x305c},
1734 {'s', 'o', 0x305d},
1735 {'z', 'o', 0x305e},
1736 {'t', 'a', 0x305f},
1737 {'d', 'a', 0x3060},
1738 {'t', 'i', 0x3061},
1739 {'d', 'i', 0x3062},
1740 {'t', 'U', 0x3063},
1741 {'t', 'u', 0x3064},
1742 {'d', 'u', 0x3065},
1743 {'t', 'e', 0x3066},
1744 {'d', 'e', 0x3067},
1745 {'t', 'o', 0x3068},
1746 {'d', 'o', 0x3069},
1747 {'n', 'a', 0x306a},
1748 {'n', 'i', 0x306b},
1749 {'n', 'u', 0x306c},
1750 {'n', 'e', 0x306d},
1751 {'n', 'o', 0x306e},
1752 {'h', 'a', 0x306f},
1753 {'b', 'a', 0x3070},
1754 {'p', 'a', 0x3071},
1755 {'h', 'i', 0x3072},
1756 {'b', 'i', 0x3073},
1757 {'p', 'i', 0x3074},
1758 {'h', 'u', 0x3075},
1759 {'b', 'u', 0x3076},
1760 {'p', 'u', 0x3077},
1761 {'h', 'e', 0x3078},
1762 {'b', 'e', 0x3079},
1763 {'p', 'e', 0x307a},
1764 {'h', 'o', 0x307b},
1765 {'b', 'o', 0x307c},
1766 {'p', 'o', 0x307d},
1767 {'m', 'a', 0x307e},
1768 {'m', 'i', 0x307f},
1769 {'m', 'u', 0x3080},
1770 {'m', 'e', 0x3081},
1771 {'m', 'o', 0x3082},
1772 {'y', 'A', 0x3083},
1773 {'y', 'a', 0x3084},
1774 {'y', 'U', 0x3085},
1775 {'y', 'u', 0x3086},
1776 {'y', 'O', 0x3087},
1777 {'y', 'o', 0x3088},
1778 {'r', 'a', 0x3089},
1779 {'r', 'i', 0x308a},
1780 {'r', 'u', 0x308b},
1781 {'r', 'e', 0x308c},
1782 {'r', 'o', 0x308d},
1783 {'w', 'A', 0x308e},
1784 {'w', 'a', 0x308f},
1785 {'w', 'i', 0x3090},
1786 {'w', 'e', 0x3091},
1787 {'w', 'o', 0x3092},
1788 {'n', '5', 0x3093},
1789 {'v', 'u', 0x3094},
1790 {'"', '5', 0x309b},
1791 {'0', '5', 0x309c},
1792 {'*', '5', 0x309d},
1793 {'+', '5', 0x309e},
1794 {'a', '6', 0x30a1},
1795 {'A', '6', 0x30a2},
1796 {'i', '6', 0x30a3},
1797 {'I', '6', 0x30a4},
1798 {'u', '6', 0x30a5},
1799 {'U', '6', 0x30a6},
1800 {'e', '6', 0x30a7},
1801 {'E', '6', 0x30a8},
1802 {'o', '6', 0x30a9},
1803 {'O', '6', 0x30aa},
1804 {'K', 'a', 0x30ab},
1805 {'G', 'a', 0x30ac},
1806 {'K', 'i', 0x30ad},
1807 {'G', 'i', 0x30ae},
1808 {'K', 'u', 0x30af},
1809 {'G', 'u', 0x30b0},
1810 {'K', 'e', 0x30b1},
1811 {'G', 'e', 0x30b2},
1812 {'K', 'o', 0x30b3},
1813 {'G', 'o', 0x30b4},
1814 {'S', 'a', 0x30b5},
1815 {'Z', 'a', 0x30b6},
1816 {'S', 'i', 0x30b7},
1817 {'Z', 'i', 0x30b8},
1818 {'S', 'u', 0x30b9},
1819 {'Z', 'u', 0x30ba},
1820 {'S', 'e', 0x30bb},
1821 {'Z', 'e', 0x30bc},
1822 {'S', 'o', 0x30bd},
1823 {'Z', 'o', 0x30be},
1824 {'T', 'a', 0x30bf},
1825 {'D', 'a', 0x30c0},
1826 {'T', 'i', 0x30c1},
1827 {'D', 'i', 0x30c2},
1828 {'T', 'U', 0x30c3},
1829 {'T', 'u', 0x30c4},
1830 {'D', 'u', 0x30c5},
1831 {'T', 'e', 0x30c6},
1832 {'D', 'e', 0x30c7},
1833 {'T', 'o', 0x30c8},
1834 {'D', 'o', 0x30c9},
1835 {'N', 'a', 0x30ca},
1836 {'N', 'i', 0x30cb},
1837 {'N', 'u', 0x30cc},
1838 {'N', 'e', 0x30cd},
1839 {'N', 'o', 0x30ce},
1840 {'H', 'a', 0x30cf},
1841 {'B', 'a', 0x30d0},
1842 {'P', 'a', 0x30d1},
1843 {'H', 'i', 0x30d2},
1844 {'B', 'i', 0x30d3},
1845 {'P', 'i', 0x30d4},
1846 {'H', 'u', 0x30d5},
1847 {'B', 'u', 0x30d6},
1848 {'P', 'u', 0x30d7},
1849 {'H', 'e', 0x30d8},
1850 {'B', 'e', 0x30d9},
1851 {'P', 'e', 0x30da},
1852 {'H', 'o', 0x30db},
1853 {'B', 'o', 0x30dc},
1854 {'P', 'o', 0x30dd},
1855 {'M', 'a', 0x30de},
1856 {'M', 'i', 0x30df},
1857 {'M', 'u', 0x30e0},
1858 {'M', 'e', 0x30e1},
1859 {'M', 'o', 0x30e2},
1860 {'Y', 'A', 0x30e3},
1861 {'Y', 'a', 0x30e4},
1862 {'Y', 'U', 0x30e5},
1863 {'Y', 'u', 0x30e6},
1864 {'Y', 'O', 0x30e7},
1865 {'Y', 'o', 0x30e8},
1866 {'R', 'a', 0x30e9},
1867 {'R', 'i', 0x30ea},
1868 {'R', 'u', 0x30eb},
1869 {'R', 'e', 0x30ec},
1870 {'R', 'o', 0x30ed},
1871 {'W', 'A', 0x30ee},
1872 {'W', 'a', 0x30ef},
1873 {'W', 'i', 0x30f0},
1874 {'W', 'e', 0x30f1},
1875 {'W', 'o', 0x30f2},
1876 {'N', '6', 0x30f3},
1877 {'V', 'u', 0x30f4},
1878 {'K', 'A', 0x30f5},
1879 {'K', 'E', 0x30f6},
1880 {'V', 'a', 0x30f7},
1881 {'V', 'i', 0x30f8},
1882 {'V', 'e', 0x30f9},
1883 {'V', 'o', 0x30fa},
1884 {'.', '6', 0x30fb},
1885 {'-', '6', 0x30fc},
1886 {'*', '6', 0x30fd},
1887 {'+', '6', 0x30fe},
1888 {'b', '4', 0x3105},
1889 {'p', '4', 0x3106},
1890 {'m', '4', 0x3107},
1891 {'f', '4', 0x3108},
1892 {'d', '4', 0x3109},
1893 {'t', '4', 0x310a},
1894 {'n', '4', 0x310b},
1895 {'l', '4', 0x310c},
1896 {'g', '4', 0x310d},
1897 {'k', '4', 0x310e},
1898 {'h', '4', 0x310f},
1899 {'j', '4', 0x3110},
1900 {'q', '4', 0x3111},
1901 {'x', '4', 0x3112},
1902 {'z', 'h', 0x3113},
1903 {'c', 'h', 0x3114},
1904 {'s', 'h', 0x3115},
1905 {'r', '4', 0x3116},
1906 {'z', '4', 0x3117},
1907 {'c', '4', 0x3118},
1908 {'s', '4', 0x3119},
1909 {'a', '4', 0x311a},
1910 {'o', '4', 0x311b},
1911 {'e', '4', 0x311c},
1912 {'a', 'i', 0x311e},
1913 {'e', 'i', 0x311f},
1914 {'a', 'u', 0x3120},
1915 {'o', 'u', 0x3121},
1916 {'a', 'n', 0x3122},
1917 {'e', 'n', 0x3123},
1918 {'a', 'N', 0x3124},
1919 {'e', 'N', 0x3125},
1920 {'e', 'r', 0x3126},
1921 {'i', '4', 0x3127},
1922 {'u', '4', 0x3128},
1923 {'i', 'u', 0x3129},
1924 {'v', '4', 0x312a},
1925 {'n', 'G', 0x312b},
1926 {'g', 'n', 0x312c},
1927 {'1', 'c', 0x3220},
1928 {'2', 'c', 0x3221},
1929 {'3', 'c', 0x3222},
1930 {'4', 'c', 0x3223},
1931 {'5', 'c', 0x3224},
1932 {'6', 'c', 0x3225},
1933 {'7', 'c', 0x3226},
1934 {'8', 'c', 0x3227},
1935 {'9', 'c', 0x3228},
1936 {' ', ' ', 0xe000},
1937 {'/', 'c', 0xe001},
1938 {'U', 'A', 0xe002},
1939 {'U', 'B', 0xe003},
1940 {'"', '3', 0xe004},
1941 {'"', '1', 0xe005},
1942 {'"', '!', 0xe006},
1943 {'"', '\'', 0xe007},
1944 {'"', '>', 0xe008},
1945 {'"', '?', 0xe009},
1946 {'"', '-', 0xe00a},
1947 {'"', '(', 0xe00b},
1948 {'"', '.', 0xe00c},
1949 {'"', ':', 0xe00d},
1950 {'"', '0', 0xe00e},
1951 {'"', '"', 0xe00f},
1952 {'"', '<', 0xe010},
1953 {'"', ',', 0xe011},
1954 {'"', ';', 0xe012},
1955 {'"', '_', 0xe013},
1956 {'"', '=', 0xe014},
1957 {'"', '/', 0xe015},
1958 {'"', 'i', 0xe016},
1959 {'"', 'd', 0xe017},
1960 {'"', 'p', 0xe018},
1961 {';', ';', 0xe019},
1962 {',', ',', 0xe01a},
1963 {'b', '3', 0xe01b},
1964 {'C', 'i', 0xe01c},
1965 {'f', '(', 0xe01d},
1966 {'e', 'd', 0xe01e},
1967 {'a', 'm', 0xe01f},
1968 {'p', 'm', 0xe020},
1969 {'F', 'l', 0xe023},
1970 {'G', 'F', 0xe024},
1971 {'>', 'V', 0xe025},
1972 {'!', '*', 0xe026},
1973 {'?', '*', 0xe027},
1974 {'J', '<', 0xe028},
1975 {'f', 'f', 0xfb00},
1976 {'f', 'i', 0xfb01},
1977 {'f', 'l', 0xfb02},
1978 {'f', 't', 0xfb05},
1979 {'s', 't', 0xfb06},
1980 # endif /* FEAT_MBYTE */
1982 /* Vim 5.x compatible digraphs that don't conflict with the above */
1983 {'~', '!', 161}, /* ¡ */
1984 {'c', '|', 162}, /* ¢ */
1985 {'$', '$', 163}, /* £ */
1986 {'o', 'x', 164}, /* ¤ - currency symbol in ISO 8859-1 */
1987 {'Y', '-', 165}, /* ¥ */
1988 {'|', '|', 166}, /* ¦ */
1989 {'c', 'O', 169}, /* © */
1990 {'-', ',', 172}, /* ¬ */
1991 {'-', '=', 175}, /* ¯ */
1992 {'~', 'o', 176}, /* ° */
1993 {'2', '2', 178}, /* ² */
1994 {'3', '3', 179}, /* ³ */
1995 {'p', 'p', 182}, /* ¶ */
1996 {'~', '.', 183}, /* · */
1997 {'1', '1', 185}, /* ¹ */
1998 {'~', '?', 191}, /* ¿ */
1999 {'A', '`', 192}, /* À */
2000 {'A', '^', 194}, /* Â */
2001 {'A', '~', 195}, /* Ã */
2002 {'A', '"', 196}, /* Ä */
2003 {'A', '@', 197}, /* Å */
2004 {'E', '`', 200}, /* È */
2005 {'E', '^', 202}, /* Ê */
2006 {'E', '"', 203}, /* Ë */
2007 {'I', '`', 204}, /* Ì */
2008 {'I', '^', 206}, /* Î */
2009 {'I', '"', 207}, /* Ï */
2010 {'N', '~', 209}, /* Ñ */
2011 {'O', '`', 210}, /* Ò */
2012 {'O', '^', 212}, /* Ô */
2013 {'O', '~', 213}, /* Õ */
2014 {'/', '\\', 215}, /* × - multiplication symbol in ISO 8859-1 */
2015 {'U', '`', 217}, /* Ù */
2016 {'U', '^', 219}, /* Û */
2017 {'I', 'p', 222}, /* Þ */
2018 {'a', '`', 224}, /* à */
2019 {'a', '^', 226}, /* â */
2020 {'a', '~', 227}, /* ã */
2021 {'a', '"', 228}, /* ä */
2022 {'a', '@', 229}, /* å */
2023 {'e', '`', 232}, /* è */
2024 {'e', '^', 234}, /* ê */
2025 {'e', '"', 235}, /* ë */
2026 {'i', '`', 236}, /* ì */
2027 {'i', '^', 238}, /* î */
2028 {'n', '~', 241}, /* ñ */
2029 {'o', '`', 242}, /* ò */
2030 {'o', '^', 244}, /* ô */
2031 {'o', '~', 245}, /* õ */
2032 {'u', '`', 249}, /* ù */
2033 {'u', '^', 251}, /* û */
2034 {'y', '"', 255}, /* x XX */
2036 {NUL, NUL, NUL}
2039 # endif /* OLD_DIGRAPHS */
2041 # endif /* Macintosh */
2042 # endif /* EBCDIC */
2043 # endif /* !HPUX_DIGRAPHS */
2044 # endif /* !__MINT__ */
2045 #endif /* !MSDOS && !OS2 */
2048 * handle digraphs after typing a character
2051 do_digraph(c)
2052 int c;
2054 static int backspaced; /* character before K_BS */
2055 static int lastchar; /* last typed character */
2057 if (c == -1) /* init values */
2059 backspaced = -1;
2061 else if (p_dg)
2063 if (backspaced >= 0)
2064 c = getdigraph(backspaced, c, FALSE);
2065 backspaced = -1;
2066 if ((c == K_BS || c == Ctrl_H) && lastchar >= 0)
2067 backspaced = lastchar;
2069 lastchar = c;
2070 return c;
2074 * Get a digraph. Used after typing CTRL-K on the command line or in normal
2075 * mode.
2076 * Returns composed character, or NUL when ESC was used.
2079 get_digraph(cmdline)
2080 int cmdline; /* TRUE when called from the cmdline */
2082 int c, cc;
2084 ++no_mapping;
2085 ++allow_keys;
2086 c = plain_vgetc();
2087 --no_mapping;
2088 --allow_keys;
2089 if (c != ESC) /* ESC cancels CTRL-K */
2091 if (IS_SPECIAL(c)) /* insert special key code */
2092 return c;
2093 if (cmdline)
2095 if (char2cells(c) == 1
2096 #if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
2097 && cmdline_star == 0
2098 #endif
2100 putcmdline(c, TRUE);
2102 #ifdef FEAT_CMDL_INFO
2103 else
2104 add_to_showcmd(c);
2105 #endif
2106 ++no_mapping;
2107 ++allow_keys;
2108 cc = plain_vgetc();
2109 --no_mapping;
2110 --allow_keys;
2111 if (cc != ESC) /* ESC cancels CTRL-K */
2112 return getdigraph(c, cc, TRUE);
2114 return NUL;
2118 * Lookup the pair "char1", "char2" in the digraph tables.
2119 * If no match, return "char2".
2120 * If "meta" is TRUE and "char1" is a space, return "char2" | 0x80.
2122 static int
2123 getexactdigraph(char1, char2, meta)
2124 int char1;
2125 int char2;
2126 int meta;
2128 int i;
2129 int retval = 0;
2130 digr_T *dp;
2132 if (IS_SPECIAL(char1) || IS_SPECIAL(char2))
2133 return char2;
2136 * Search user digraphs first.
2138 dp = (digr_T *)user_digraphs.ga_data;
2139 for (i = 0; i < user_digraphs.ga_len; ++i)
2141 if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
2143 retval = dp->result;
2144 break;
2146 ++dp;
2150 * Search default digraphs.
2152 if (retval == 0)
2154 dp = digraphdefault;
2155 for (i = 0; dp->char1 != 0; ++i)
2157 if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
2159 retval = dp->result;
2160 break;
2162 ++dp;
2165 #ifdef FEAT_MBYTE
2166 # ifdef USE_UNICODE_DIGRAPHS
2167 if (retval != 0 && !enc_utf8)
2169 char_u buf[6], *to;
2170 vimconv_T vc;
2173 * Convert the Unicode digraph to 'encoding'.
2175 i = utf_char2bytes(retval, buf);
2176 retval = 0;
2177 vc.vc_type = CONV_NONE;
2178 if (convert_setup(&vc, (char_u *)"utf-8", p_enc) == OK)
2180 vc.vc_fail = TRUE;
2181 to = string_convert(&vc, buf, &i);
2182 if (to != NULL)
2184 retval = (*mb_ptr2char)(to);
2185 vim_free(to);
2187 (void)convert_setup(&vc, NULL, NULL);
2190 # endif
2192 /* Ignore multi-byte characters when not in multi-byte mode. */
2193 if (!has_mbyte && retval > 0xff)
2194 retval = 0;
2195 #endif
2197 if (retval == 0) /* digraph deleted or not found */
2199 if (char1 == ' ' && meta) /* <space> <char> --> meta-char */
2200 return (char2 | 0x80);
2201 return char2;
2203 return retval;
2207 * Get digraph.
2208 * Allow for both char1-char2 and char2-char1
2211 getdigraph(char1, char2, meta)
2212 int char1;
2213 int char2;
2214 int meta;
2216 int retval;
2218 if (((retval = getexactdigraph(char1, char2, meta)) == char2)
2219 && (char1 != char2)
2220 && ((retval = getexactdigraph(char2, char1, meta)) == char1))
2221 return char2;
2222 return retval;
2226 * Add the digraphs in the argument to the digraph table.
2227 * format: {c1}{c2} char {c1}{c2} char ...
2229 void
2230 putdigraph(str)
2231 char_u *str;
2233 int char1, char2, n;
2234 int i;
2235 digr_T *dp;
2237 while (*str != NUL)
2239 str = skipwhite(str);
2240 if (*str == NUL)
2241 return;
2242 char1 = *str++;
2243 char2 = *str++;
2244 if (char2 == 0)
2246 EMSG(_(e_invarg));
2247 return;
2249 if (char1 == ESC || char2 == ESC)
2251 EMSG(_("E104: Escape not allowed in digraph"));
2252 return;
2254 str = skipwhite(str);
2255 if (!VIM_ISDIGIT(*str))
2257 EMSG(_(e_number_exp));
2258 return;
2260 n = getdigits(&str);
2262 /* If the digraph already exists, replace the result. */
2263 dp = (digr_T *)user_digraphs.ga_data;
2264 for (i = 0; i < user_digraphs.ga_len; ++i)
2266 if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
2268 dp->result = n;
2269 break;
2271 ++dp;
2274 /* Add a new digraph to the table. */
2275 if (i == user_digraphs.ga_len)
2277 if (ga_grow(&user_digraphs, 1) == OK)
2279 dp = (digr_T *)user_digraphs.ga_data + user_digraphs.ga_len;
2280 dp->char1 = char1;
2281 dp->char2 = char2;
2282 dp->result = n;
2283 ++user_digraphs.ga_len;
2289 void
2290 listdigraphs()
2292 int i;
2293 digr_T *dp;
2295 msg_putchar('\n');
2297 dp = digraphdefault;
2298 for (i = 0; dp->char1 != NUL && !got_int; ++i)
2300 #if defined(USE_UNICODE_DIGRAPHS) && defined(FEAT_MBYTE)
2301 digr_T tmp;
2303 /* May need to convert the result to 'encoding'. */
2304 tmp.char1 = dp->char1;
2305 tmp.char2 = dp->char2;
2306 tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE);
2307 if (tmp.result != 0 && tmp.result != tmp.char2
2308 && (has_mbyte || tmp.result <= 255))
2309 printdigraph(&tmp);
2310 #else
2312 if (getexactdigraph(dp->char1, dp->char2, FALSE) == dp->result
2313 # ifdef FEAT_MBYTE
2314 && (has_mbyte || dp->result <= 255)
2315 # endif
2317 printdigraph(dp);
2318 #endif
2319 ++dp;
2320 ui_breakcheck();
2323 dp = (digr_T *)user_digraphs.ga_data;
2324 for (i = 0; i < user_digraphs.ga_len && !got_int; ++i)
2326 printdigraph(dp);
2327 ui_breakcheck();
2328 ++dp;
2330 must_redraw = CLEAR; /* clear screen, because some digraphs may be
2331 wrong, in which case we messed up ScreenLines */
2334 static void
2335 printdigraph(dp)
2336 digr_T *dp;
2338 char_u buf[30];
2339 char_u *p;
2341 int list_width;
2343 if ((dy_flags & DY_UHEX)
2344 #ifdef FEAT_MBYTE
2345 || has_mbyte
2346 #endif
2348 list_width = 13;
2349 else
2350 list_width = 11;
2352 if (dp->result != 0)
2354 if (msg_col > Columns - list_width)
2355 msg_putchar('\n');
2356 if (msg_col)
2357 while (msg_col % list_width != 0)
2358 msg_putchar(' ');
2360 p = buf;
2361 *p++ = dp->char1;
2362 *p++ = dp->char2;
2363 *p++ = ' ';
2364 #ifdef FEAT_MBYTE
2365 if (has_mbyte)
2367 /* add a space to draw a composing char on */
2368 if (enc_utf8 && utf_iscomposing(dp->result))
2369 *p++ = ' ';
2370 p += (*mb_char2bytes)(dp->result, p);
2372 else
2373 #endif
2374 *p++ = dp->result;
2375 if (char2cells(dp->result) == 1)
2376 *p++ = ' ';
2377 sprintf((char *)p, " %3d", dp->result);
2378 msg_outtrans(buf);
2382 #endif /* FEAT_DIGRAPHS */
2384 #if defined(FEAT_KEYMAP) || defined(PROTO)
2386 /* structure used for b_kmap_ga.ga_data */
2387 typedef struct
2389 char_u *from;
2390 char_u *to;
2391 } kmap_T;
2393 #define KMAP_MAXLEN 20 /* maximum length of "from" or "to" */
2395 static void keymap_unload __ARGS((void));
2398 * Set up key mapping tables for the 'keymap' option
2400 char_u *
2401 keymap_init()
2403 curbuf->b_kmap_state &= ~KEYMAP_INIT;
2405 if (*curbuf->b_p_keymap == NUL)
2407 /* Stop any active keymap and clear the table. Also remove
2408 * b:keymap_name, as no keymap is active now. */
2409 keymap_unload();
2410 do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
2412 else
2414 char_u *buf;
2416 /* Source the keymap file. It will contain a ":loadkeymap" command
2417 * which will call ex_loadkeymap() below. */
2418 buf = alloc((unsigned)(STRLEN(curbuf->b_p_keymap)
2419 # ifdef FEAT_MBYTE
2420 + STRLEN(p_enc)
2421 # endif
2422 + 14));
2423 if (buf == NULL)
2424 return e_outofmem;
2426 # ifdef FEAT_MBYTE
2427 /* try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' */
2428 sprintf((char *)buf, "keymap/%s_%s.vim", curbuf->b_p_keymap, p_enc);
2429 if (source_runtime(buf, FALSE) == FAIL)
2430 # endif
2432 /* try finding "keymap/'keymap'.vim" in 'runtimepath' */
2433 sprintf((char *)buf, "keymap/%s.vim", curbuf->b_p_keymap);
2434 if (source_runtime(buf, FALSE) == FAIL)
2436 vim_free(buf);
2437 return (char_u *)N_("E544: Keymap file not found");
2440 vim_free(buf);
2443 return NULL;
2447 * ":loadkeymap" command: load the following lines as the keymap.
2449 void
2450 ex_loadkeymap(eap)
2451 exarg_T *eap;
2453 char_u *line;
2454 char_u *p;
2455 char_u *s;
2456 kmap_T *kp;
2457 #define KMAP_LLEN 200 /* max length of "to" and "from" together */
2458 char_u buf[KMAP_LLEN + 11];
2459 int i;
2460 char_u *save_cpo = p_cpo;
2462 if (!getline_equal(eap->getline, eap->cookie, getsourceline))
2464 EMSG(_("E105: Using :loadkeymap not in a sourced file"));
2465 return;
2469 * Stop any active keymap and clear the table.
2471 keymap_unload();
2473 curbuf->b_kmap_state = 0;
2474 ga_init2(&curbuf->b_kmap_ga, (int)sizeof(kmap_T), 20);
2476 /* Set 'cpoptions' to "C" to avoid line continuation. */
2477 p_cpo = (char_u *)"C";
2480 * Get each line of the sourced file, break at the end.
2482 for (;;)
2484 line = eap->getline(0, eap->cookie, 0);
2485 if (line == NULL)
2486 break;
2488 p = skipwhite(line);
2489 if (*p != '"' && *p != NUL && ga_grow(&curbuf->b_kmap_ga, 1) == OK)
2491 kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len;
2492 s = skiptowhite(p);
2493 kp->from = vim_strnsave(p, (int)(s - p));
2494 p = skipwhite(s);
2495 s = skiptowhite(p);
2496 kp->to = vim_strnsave(p, (int)(s - p));
2498 if (kp->from == NULL || kp->to == NULL
2499 || STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN
2500 || *kp->from == NUL || *kp->to == NUL)
2502 if (kp->to != NULL && *kp->to == NUL)
2503 EMSG(_("E791: Empty keymap entry"));
2504 vim_free(kp->from);
2505 vim_free(kp->to);
2507 else
2508 ++curbuf->b_kmap_ga.ga_len;
2510 vim_free(line);
2514 * setup ":lnoremap" to map the keys
2516 for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i)
2518 vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s %s",
2519 ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].from,
2520 ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].to);
2521 (void)do_map(2, buf, LANGMAP, FALSE);
2524 p_cpo = save_cpo;
2526 curbuf->b_kmap_state |= KEYMAP_LOADED;
2527 #ifdef FEAT_WINDOWS
2528 status_redraw_curbuf();
2529 #endif
2533 * Stop using 'keymap'.
2535 static void
2536 keymap_unload()
2538 char_u buf[KMAP_MAXLEN + 10];
2539 int i;
2540 char_u *save_cpo = p_cpo;
2541 kmap_T *kp;
2543 if (!(curbuf->b_kmap_state & KEYMAP_LOADED))
2544 return;
2546 /* Set 'cpoptions' to "C" to avoid line continuation. */
2547 p_cpo = (char_u *)"C";
2549 /* clear the ":lmap"s */
2550 kp = (kmap_T *)curbuf->b_kmap_ga.ga_data;
2551 for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i)
2553 vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s", kp[i].from);
2554 (void)do_map(1, buf, LANGMAP, FALSE);
2555 vim_free(kp[i].from);
2556 vim_free(kp[i].to);
2559 p_cpo = save_cpo;
2561 ga_clear(&curbuf->b_kmap_ga);
2562 curbuf->b_kmap_state &= ~KEYMAP_LOADED;
2563 #ifdef FEAT_WINDOWS
2564 status_redraw_curbuf();
2565 #endif
2568 #endif /* FEAT_KEYMAP */