1/* vi:set ts=8 sts=4 sw=4:
2 *
3 * VIM - Vi IMproved	by Bram Moolenaar
4 *
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 */
9
10/*
11 * digraph.c: code for digraphs
12 */
13
14#include "vim.h"
15
16#if defined(FEAT_DIGRAPHS) || defined(PROTO)
17
18#ifdef FEAT_MBYTE
19typedef int result_T;
20#else
21typedef char_u result_T;
22#endif
23
24typedef struct digraph
25{
26    char_u	char1;
27    char_u	char2;
28    result_T	result;
29} digr_T;
30
31static int getexactdigraph __ARGS((int, int, int));
32static void printdigraph __ARGS((digr_T *));
33
34/* digraphs added by the user */
35static garray_T	user_digraphs = {0, 0, (int)sizeof(digr_T), 10, NULL};
36
37/*
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).
40 */
41static digr_T digraphdefault[] =
42#if defined(MSDOS) || defined(OS2)
43	/*
44	 * MSDOS digraphs.
45	 */
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},	/* � */
94
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}
106	};
107
108#else	/* !MSDOS && !OS2 */
109# ifdef __MINT__
110
111	/*
112	 * ATARI digraphs
113	 */
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}
172	};
173
174# else	/* !__MINT__ */
175#  ifdef HPUX_DIGRAPHS
176
177	/*
178	 * different HPUX digraphs
179	 */
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}
276	};
277
278#  else	/* !HPUX_DIGRAPHS */
279
280#   ifdef EBCDIC
281
282	/*
283	 * EBCDIC - ISO digraphs
284	 * TODO: EBCDIC Table is Code-Page 1047
285	 */
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}
388	};
389
390#   else
391#    if defined(MACOS) && !defined(FEAT_MBYTE)
392
393	/*
394	 * Macintosh digraphs
395	 */
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}
517	};
518
519#    else	/* !MACOS */
520
521#     ifdef OLD_DIGRAPHS
522
523	/*
524	 * digraphs compatible with Vim 5.x
525	 */
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}
627	};
628#     else /* OLD_DIGRAPHS */
629
630	/*
631	 * digraphs for Unicode from RFC1345
632	 * (also work for ISO-8859-1 aka latin1)
633	 */
634       {
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},
809
810#      ifdef FEAT_MBYTE
811#	define USE_UNICODE_DIGRAPHS
812
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	/* code points 0xe000 - 0xefff excluded, they have no assigned
1937	 * characters, only used in proposals. */
1938	{'f', 'f', 0xfb00},
1939	{'f', 'i', 0xfb01},
1940	{'f', 'l', 0xfb02},
1941	{'f', 't', 0xfb05},
1942	{'s', 't', 0xfb06},
1943#      endif /* FEAT_MBYTE */
1944
1945	/* Vim 5.x compatible digraphs that don't conflict with the above */
1946	{'~', '!', 161},	/* � */
1947	{'c', '|', 162},	/* � */
1948	{'$', '$', 163},	/* � */
1949	{'o', 'x', 164},	/* � - currency symbol in ISO 8859-1 */
1950	{'Y', '-', 165},	/* � */
1951	{'|', '|', 166},	/* � */
1952	{'c', 'O', 169},	/* � */
1953	{'-', ',', 172},	/* � */
1954	{'-', '=', 175},	/* � */
1955	{'~', 'o', 176},	/* � */
1956	{'2', '2', 178},	/* � */
1957	{'3', '3', 179},	/* � */
1958	{'p', 'p', 182},	/* � */
1959	{'~', '.', 183},	/* � */
1960	{'1', '1', 185},	/* � */
1961	{'~', '?', 191},	/* � */
1962	{'A', '`', 192},	/* � */
1963	{'A', '^', 194},	/* � */
1964	{'A', '~', 195},	/* � */
1965	{'A', '"', 196},	/* � */
1966	{'A', '@', 197},	/* � */
1967	{'E', '`', 200},	/* � */
1968	{'E', '^', 202},	/* � */
1969	{'E', '"', 203},	/* � */
1970	{'I', '`', 204},	/* � */
1971	{'I', '^', 206},	/* � */
1972	{'I', '"', 207},	/* � */
1973	{'N', '~', 209},	/* � */
1974	{'O', '`', 210},	/* � */
1975	{'O', '^', 212},	/* � */
1976	{'O', '~', 213},	/* � */
1977	{'/', '\\', 215},	/* � - multiplication symbol in ISO 8859-1 */
1978	{'U', '`', 217},	/* � */
1979	{'U', '^', 219},	/* � */
1980	{'I', 'p', 222},	/* � */
1981	{'a', '`', 224},	/* � */
1982	{'a', '^', 226},	/* � */
1983	{'a', '~', 227},	/* � */
1984	{'a', '"', 228},	/* � */
1985	{'a', '@', 229},	/* � */
1986	{'e', '`', 232},	/* � */
1987	{'e', '^', 234},	/* � */
1988	{'e', '"', 235},	/* � */
1989	{'i', '`', 236},	/* � */
1990	{'i', '^', 238},	/* � */
1991	{'n', '~', 241},	/* � */
1992	{'o', '`', 242},	/* � */
1993	{'o', '^', 244},	/* � */
1994	{'o', '~', 245},	/* � */
1995	{'u', '`', 249},	/* � */
1996	{'u', '^', 251},	/* � */
1997	{'y', '"', 255},	/* x XX */
1998
1999	{NUL, NUL, NUL}
2000       };
2001
2002#     endif /* OLD_DIGRAPHS */
2003
2004#    endif /* Macintosh */
2005#   endif /* EBCDIC */
2006#  endif    /* !HPUX_DIGRAPHS */
2007# endif	/* !__MINT__ */
2008#endif	/* !MSDOS && !OS2 */
2009
2010/*
2011 * handle digraphs after typing a character
2012 */
2013    int
2014do_digraph(c)
2015    int	    c;
2016{
2017    static int	backspaced;	/* character before K_BS */
2018    static int	lastchar;	/* last typed character */
2019
2020    if (c == -1)		/* init values */
2021    {
2022	backspaced = -1;
2023    }
2024    else if (p_dg)
2025    {
2026	if (backspaced >= 0)
2027	    c = getdigraph(backspaced, c, FALSE);
2028	backspaced = -1;
2029	if ((c == K_BS || c == Ctrl_H) && lastchar >= 0)
2030	    backspaced = lastchar;
2031    }
2032    lastchar = c;
2033    return c;
2034}
2035
2036/*
2037 * Get a digraph.  Used after typing CTRL-K on the command line or in normal
2038 * mode.
2039 * Returns composed character, or NUL when ESC was used.
2040 */
2041    int
2042get_digraph(cmdline)
2043    int		cmdline;	/* TRUE when called from the cmdline */
2044{
2045    int		c, cc;
2046
2047    ++no_mapping;
2048    ++allow_keys;
2049    c = plain_vgetc();
2050    --no_mapping;
2051    --allow_keys;
2052    if (c != ESC)		/* ESC cancels CTRL-K */
2053    {
2054	if (IS_SPECIAL(c))	/* insert special key code */
2055	    return c;
2056	if (cmdline)
2057	{
2058	    if (char2cells(c) == 1
2059#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
2060		    && cmdline_star == 0
2061#endif
2062		    )
2063		putcmdline(c, TRUE);
2064	}
2065#ifdef FEAT_CMDL_INFO
2066	else
2067	    add_to_showcmd(c);
2068#endif
2069	++no_mapping;
2070	++allow_keys;
2071	cc = plain_vgetc();
2072	--no_mapping;
2073	--allow_keys;
2074	if (cc != ESC)	    /* ESC cancels CTRL-K */
2075	    return getdigraph(c, cc, TRUE);
2076    }
2077    return NUL;
2078}
2079
2080/*
2081 * Lookup the pair "char1", "char2" in the digraph tables.
2082 * If no match, return "char2".
2083 * If "meta" is TRUE and "char1" is a space, return "char2" | 0x80.
2084 */
2085    static int
2086getexactdigraph(char1, char2, meta)
2087    int		char1;
2088    int		char2;
2089    int		meta;
2090{
2091    int		i;
2092    int		retval = 0;
2093    digr_T	*dp;
2094
2095    if (IS_SPECIAL(char1) || IS_SPECIAL(char2))
2096	return char2;
2097
2098    /*
2099     * Search user digraphs first.
2100     */
2101    dp = (digr_T *)user_digraphs.ga_data;
2102    for (i = 0; i < user_digraphs.ga_len; ++i)
2103    {
2104	if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
2105	{
2106	    retval = dp->result;
2107	    break;
2108	}
2109	++dp;
2110    }
2111
2112    /*
2113     * Search default digraphs.
2114     */
2115    if (retval == 0)
2116    {
2117	dp = digraphdefault;
2118	for (i = 0; dp->char1 != 0; ++i)
2119	{
2120	    if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
2121	    {
2122		retval = dp->result;
2123		break;
2124	    }
2125	    ++dp;
2126	}
2127    }
2128#ifdef FEAT_MBYTE
2129# ifdef USE_UNICODE_DIGRAPHS
2130    if (retval != 0 && !enc_utf8)
2131    {
2132	char_u	    buf[6], *to;
2133	vimconv_T   vc;
2134
2135	/*
2136	 * Convert the Unicode digraph to 'encoding'.
2137	 */
2138	i = utf_char2bytes(retval, buf);
2139	retval = 0;
2140	vc.vc_type = CONV_NONE;
2141	if (convert_setup(&vc, (char_u *)"utf-8", p_enc) == OK)
2142	{
2143	    vc.vc_fail = TRUE;
2144	    to = string_convert(&vc, buf, &i);
2145	    if (to != NULL)
2146	    {
2147		retval = (*mb_ptr2char)(to);
2148		vim_free(to);
2149	    }
2150	    (void)convert_setup(&vc, NULL, NULL);
2151	}
2152    }
2153# endif
2154
2155    /* Ignore multi-byte characters when not in multi-byte mode. */
2156    if (!has_mbyte && retval > 0xff)
2157	retval = 0;
2158#endif
2159
2160    if (retval == 0)		/* digraph deleted or not found */
2161    {
2162	if (char1 == ' ' && meta)	/* <space> <char> --> meta-char */
2163	    return (char2 | 0x80);
2164	return char2;
2165    }
2166    return retval;
2167}
2168
2169/*
2170 * Get digraph.
2171 * Allow for both char1-char2 and char2-char1
2172 */
2173    int
2174getdigraph(char1, char2, meta)
2175    int	char1;
2176    int	char2;
2177    int	meta;
2178{
2179    int	    retval;
2180
2181    if (((retval = getexactdigraph(char1, char2, meta)) == char2)
2182	    && (char1 != char2)
2183	    && ((retval = getexactdigraph(char2, char1, meta)) == char1))
2184	return char2;
2185    return retval;
2186}
2187
2188/*
2189 * Add the digraphs in the argument to the digraph table.
2190 * format: {c1}{c2} char {c1}{c2} char ...
2191 */
2192    void
2193putdigraph(str)
2194    char_u *str;
2195{
2196    int		char1, char2, n;
2197    int		i;
2198    digr_T	*dp;
2199
2200    while (*str != NUL)
2201    {
2202	str = skipwhite(str);
2203	if (*str == NUL)
2204	    return;
2205	char1 = *str++;
2206	char2 = *str++;
2207	if (char2 == 0)
2208	{
2209	    EMSG(_(e_invarg));
2210	    return;
2211	}
2212	if (char1 == ESC || char2 == ESC)
2213	{
2214	    EMSG(_("E104: Escape not allowed in digraph"));
2215	    return;
2216	}
2217	str = skipwhite(str);
2218	if (!VIM_ISDIGIT(*str))
2219	{
2220	    EMSG(_(e_number_exp));
2221	    return;
2222	}
2223	n = getdigits(&str);
2224
2225	/* If the digraph already exists, replace the result. */
2226	dp = (digr_T *)user_digraphs.ga_data;
2227	for (i = 0; i < user_digraphs.ga_len; ++i)
2228	{
2229	    if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
2230	    {
2231		dp->result = n;
2232		break;
2233	    }
2234	    ++dp;
2235	}
2236
2237	/* Add a new digraph to the table. */
2238	if (i == user_digraphs.ga_len)
2239	{
2240	    if (ga_grow(&user_digraphs, 1) == OK)
2241	    {
2242		dp = (digr_T *)user_digraphs.ga_data + user_digraphs.ga_len;
2243		dp->char1 = char1;
2244		dp->char2 = char2;
2245		dp->result = n;
2246		++user_digraphs.ga_len;
2247	    }
2248	}
2249    }
2250}
2251
2252    void
2253listdigraphs()
2254{
2255    int		i;
2256    digr_T	*dp;
2257
2258    msg_putchar('\n');
2259
2260    dp = digraphdefault;
2261    for (i = 0; dp->char1 != NUL && !got_int; ++i)
2262    {
2263#if defined(USE_UNICODE_DIGRAPHS) && defined(FEAT_MBYTE)
2264	digr_T tmp;
2265
2266	/* May need to convert the result to 'encoding'. */
2267	tmp.char1 = dp->char1;
2268	tmp.char2 = dp->char2;
2269	tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE);
2270	if (tmp.result != 0 && tmp.result != tmp.char2
2271					  && (has_mbyte || tmp.result <= 255))
2272	    printdigraph(&tmp);
2273#else
2274
2275	if (getexactdigraph(dp->char1, dp->char2, FALSE) == dp->result
2276# ifdef FEAT_MBYTE
2277		&& (has_mbyte || dp->result <= 255)
2278# endif
2279		)
2280	    printdigraph(dp);
2281#endif
2282	++dp;
2283	ui_breakcheck();
2284    }
2285
2286    dp = (digr_T *)user_digraphs.ga_data;
2287    for (i = 0; i < user_digraphs.ga_len && !got_int; ++i)
2288    {
2289	printdigraph(dp);
2290	ui_breakcheck();
2291	++dp;
2292    }
2293    must_redraw = CLEAR;    /* clear screen, because some digraphs may be
2294			       wrong, in which case we messed up ScreenLines */
2295}
2296
2297    static void
2298printdigraph(dp)
2299    digr_T	*dp;
2300{
2301    char_u	buf[30];
2302    char_u	*p;
2303
2304    int		list_width;
2305
2306    if ((dy_flags & DY_UHEX)
2307#ifdef FEAT_MBYTE
2308	    || has_mbyte
2309#endif
2310	    )
2311	list_width = 13;
2312    else
2313	list_width = 11;
2314
2315    if (dp->result != 0)
2316    {
2317	if (msg_col > Columns - list_width)
2318	    msg_putchar('\n');
2319	if (msg_col)
2320	    while (msg_col % list_width != 0)
2321		msg_putchar(' ');
2322
2323	p = buf;
2324	*p++ = dp->char1;
2325	*p++ = dp->char2;
2326	*p++ = ' ';
2327#ifdef FEAT_MBYTE
2328	if (has_mbyte)
2329	{
2330	    /* add a space to draw a composing char on */
2331	    if (enc_utf8 && utf_iscomposing(dp->result))
2332		*p++ = ' ';
2333	    p += (*mb_char2bytes)(dp->result, p);
2334	}
2335	else
2336#endif
2337	    *p++ = (char_u)dp->result;
2338	if (char2cells(dp->result) == 1)
2339	    *p++ = ' ';
2340	vim_snprintf((char *)p, sizeof(buf) - (p - buf), " %3d", dp->result);
2341	msg_outtrans(buf);
2342    }
2343}
2344
2345#endif /* FEAT_DIGRAPHS */
2346
2347#if defined(FEAT_KEYMAP) || defined(PROTO)
2348
2349/* structure used for b_kmap_ga.ga_data */
2350typedef struct
2351{
2352    char_u	*from;
2353    char_u	*to;
2354} kmap_T;
2355
2356#define KMAP_MAXLEN 20	    /* maximum length of "from" or "to" */
2357
2358static void keymap_unload __ARGS((void));
2359
2360/*
2361 * Set up key mapping tables for the 'keymap' option.
2362 * Returns NULL if OK, an error message for failure.  This only needs to be
2363 * used when setting the option, not later when the value has already been
2364 * checked.
2365 */
2366    char_u *
2367keymap_init()
2368{
2369    curbuf->b_kmap_state &= ~KEYMAP_INIT;
2370
2371    if (*curbuf->b_p_keymap == NUL)
2372    {
2373	/* Stop any active keymap and clear the table.  Also remove
2374	 * b:keymap_name, as no keymap is active now. */
2375	keymap_unload();
2376	do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
2377    }
2378    else
2379    {
2380	char_u	*buf;
2381	size_t  buflen;
2382
2383	/* Source the keymap file.  It will contain a ":loadkeymap" command
2384	 * which will call ex_loadkeymap() below. */
2385	buflen = STRLEN(curbuf->b_p_keymap)
2386# ifdef FEAT_MBYTE
2387					   + STRLEN(p_enc)
2388# endif
2389						       + 14;
2390	buf = alloc((unsigned)buflen);
2391	if (buf == NULL)
2392	    return e_outofmem;
2393
2394# ifdef FEAT_MBYTE
2395	/* try finding "keymap/'keymap'_'encoding'.vim"  in 'runtimepath' */
2396	vim_snprintf((char *)buf, buflen, "keymap/%s_%s.vim",
2397						   curbuf->b_p_keymap, p_enc);
2398	if (source_runtime(buf, FALSE) == FAIL)
2399# endif
2400	{
2401	    /* try finding "keymap/'keymap'.vim" in 'runtimepath'  */
2402	    vim_snprintf((char *)buf, buflen, "keymap/%s.vim",
2403							  curbuf->b_p_keymap);
2404	    if (source_runtime(buf, FALSE) == FAIL)
2405	    {
2406		vim_free(buf);
2407		return (char_u *)N_("E544: Keymap file not found");
2408	    }
2409	}
2410	vim_free(buf);
2411    }
2412
2413    return NULL;
2414}
2415
2416/*
2417 * ":loadkeymap" command: load the following lines as the keymap.
2418 */
2419    void
2420ex_loadkeymap(eap)
2421    exarg_T	*eap;
2422{
2423    char_u	*line;
2424    char_u	*p;
2425    char_u	*s;
2426    kmap_T	*kp;
2427#define KMAP_LLEN   200	    /* max length of "to" and "from" together */
2428    char_u	buf[KMAP_LLEN + 11];
2429    int		i;
2430    char_u	*save_cpo = p_cpo;
2431
2432    if (!getline_equal(eap->getline, eap->cookie, getsourceline))
2433    {
2434	EMSG(_("E105: Using :loadkeymap not in a sourced file"));
2435	return;
2436    }
2437
2438    /*
2439     * Stop any active keymap and clear the table.
2440     */
2441    keymap_unload();
2442
2443    curbuf->b_kmap_state = 0;
2444    ga_init2(&curbuf->b_kmap_ga, (int)sizeof(kmap_T), 20);
2445
2446    /* Set 'cpoptions' to "C" to avoid line continuation. */
2447    p_cpo = (char_u *)"C";
2448
2449    /*
2450     * Get each line of the sourced file, break at the end.
2451     */
2452    for (;;)
2453    {
2454	line = eap->getline(0, eap->cookie, 0);
2455	if (line == NULL)
2456	    break;
2457
2458	p = skipwhite(line);
2459	if (*p != '"' && *p != NUL && ga_grow(&curbuf->b_kmap_ga, 1) == OK)
2460	{
2461	    kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len;
2462	    s = skiptowhite(p);
2463	    kp->from = vim_strnsave(p, (int)(s - p));
2464	    p = skipwhite(s);
2465	    s = skiptowhite(p);
2466	    kp->to = vim_strnsave(p, (int)(s - p));
2467
2468	    if (kp->from == NULL || kp->to == NULL
2469		    || STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN
2470		    || *kp->from == NUL || *kp->to == NUL)
2471	    {
2472		if (kp->to != NULL && *kp->to == NUL)
2473		    EMSG(_("E791: Empty keymap entry"));
2474		vim_free(kp->from);
2475		vim_free(kp->to);
2476	    }
2477	    else
2478		++curbuf->b_kmap_ga.ga_len;
2479	}
2480	vim_free(line);
2481    }
2482
2483    /*
2484     * setup ":lnoremap" to map the keys
2485     */
2486    for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i)
2487    {
2488	vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s %s",
2489				((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].from,
2490				 ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].to);
2491	(void)do_map(2, buf, LANGMAP, FALSE);
2492    }
2493
2494    p_cpo = save_cpo;
2495
2496    curbuf->b_kmap_state |= KEYMAP_LOADED;
2497#ifdef FEAT_WINDOWS
2498    status_redraw_curbuf();
2499#endif
2500}
2501
2502/*
2503 * Stop using 'keymap'.
2504 */
2505    static void
2506keymap_unload()
2507{
2508    char_u	buf[KMAP_MAXLEN + 10];
2509    int		i;
2510    char_u	*save_cpo = p_cpo;
2511    kmap_T	*kp;
2512
2513    if (!(curbuf->b_kmap_state & KEYMAP_LOADED))
2514	return;
2515
2516    /* Set 'cpoptions' to "C" to avoid line continuation. */
2517    p_cpo = (char_u *)"C";
2518
2519    /* clear the ":lmap"s */
2520    kp = (kmap_T *)curbuf->b_kmap_ga.ga_data;
2521    for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i)
2522    {
2523	vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s", kp[i].from);
2524	(void)do_map(1, buf, LANGMAP, FALSE);
2525	vim_free(kp[i].from);
2526	vim_free(kp[i].to);
2527    }
2528
2529    p_cpo = save_cpo;
2530
2531    ga_clear(&curbuf->b_kmap_ga);
2532    curbuf->b_kmap_state &= ~KEYMAP_LOADED;
2533#ifdef FEAT_WINDOWS
2534    status_redraw_curbuf();
2535#endif
2536}
2537
2538#endif /* FEAT_KEYMAP */
2539
2540