xref: /haiku/src/apps/terminal/VTPrsTbl.c (revision 7a74a5df454197933bc6e80a542102362ee98703)
1 /*
2  * Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
3  * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files or portions
7  * thereof (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so, subject
11  * to the following conditions:
12  *
13  *  * Redistributions of source code must retain the above copyright notice,
14  *    this list of conditions and the following disclaimer.
15  *
16  *  * Redistributions in binary form must reproduce the above copyright notice
17  *    in the  binary, as well as this list of conditions and the following
18  *    disclaimer in the documentation and/or other materials provided with
19  *    the distribution.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27  * THE SOFTWARE.
28  *
29  */
30 
31 #include "VTparse.h"
32 
33 #define USE_MBCS
34 #define USE_ISO2022
35 
36 // #pragma mark UTF8 coding ground table
37 int gUTF8GroundTable[] =
38 {
39 /*	NUL		SOH		STX		ETX	*/
40 CASE_IGNORE,
41 CASE_IGNORE,
42 CASE_IGNORE,
43 CASE_IGNORE,
44 /*	EOT		ENQ		ACK		BEL	*/
45 CASE_IGNORE,
46 CASE_IGNORE,
47 CASE_IGNORE,
48 CASE_BELL,
49 /*	BS		HT		NL		VT	*/
50 CASE_BS,
51 CASE_TAB,
52 CASE_LF,
53 CASE_LF, /* CASE_UP*/
54 /*	NP		CR		SO		SI	*/
55 CASE_LF, /* CASE_IGNORE*/
56 CASE_CR,
57 CASE_SO,
58 CASE_SI,
59 /*	DLE		DC1		DC2		DC3	*/
60 CASE_IGNORE,
61 CASE_IGNORE,
62 CASE_IGNORE,
63 CASE_IGNORE,
64 /*	DC4		NAK		SYN		ETB	*/
65 CASE_IGNORE,
66 CASE_IGNORE,
67 CASE_IGNORE,
68 CASE_IGNORE,
69 /*	CAN		EM		SUB		ESC	*/
70 CASE_IGNORE,
71 CASE_IGNORE,
72 CASE_IGNORE,
73 CASE_ESC,
74 /*	FS		GS		RS		US	*/
75 CASE_IGNORE,
76 CASE_IGNORE,
77 CASE_IGNORE,
78 CASE_IGNORE,
79 /*	SP		!		"		#	*/
80 CASE_PRINT,
81 CASE_PRINT,
82 CASE_PRINT,
83 CASE_PRINT,
84 /*	$		%		&		'	*/
85 CASE_PRINT,
86 CASE_PRINT,
87 CASE_PRINT,
88 CASE_PRINT,
89 /*	(		)		*		+	*/
90 CASE_PRINT,
91 CASE_PRINT,
92 CASE_PRINT,
93 CASE_PRINT,
94 /*	,		-		.		/	*/
95 CASE_PRINT,
96 CASE_PRINT,
97 CASE_PRINT,
98 CASE_PRINT,
99 /*	0		1		2		3	*/
100 CASE_PRINT,
101 CASE_PRINT,
102 CASE_PRINT,
103 CASE_PRINT,
104 /*	4		5		6		7	*/
105 CASE_PRINT,
106 CASE_PRINT,
107 CASE_PRINT,
108 CASE_PRINT,
109 /*	8		9		:		;	*/
110 CASE_PRINT,
111 CASE_PRINT,
112 CASE_PRINT,
113 CASE_PRINT,
114 /*	<		=		>		?	*/
115 CASE_PRINT,
116 CASE_PRINT,
117 CASE_PRINT,
118 CASE_PRINT,
119 /*	@		A		B		C	*/
120 CASE_PRINT,
121 CASE_PRINT,
122 CASE_PRINT,
123 CASE_PRINT,
124 /*	D		E		F		G	*/
125 CASE_PRINT,
126 CASE_PRINT,
127 CASE_PRINT,
128 CASE_PRINT,
129 /*	H		I		J		K	*/
130 CASE_PRINT,
131 CASE_PRINT,
132 CASE_PRINT,
133 CASE_PRINT,
134 /*	L		M		N		O	*/
135 CASE_PRINT,
136 CASE_PRINT,
137 CASE_PRINT,
138 CASE_PRINT,
139 /*	P		Q		R		S	*/
140 CASE_PRINT,
141 CASE_PRINT,
142 CASE_PRINT,
143 CASE_PRINT,
144 /*	T		U		V		W	*/
145 CASE_PRINT,
146 CASE_PRINT,
147 CASE_PRINT,
148 CASE_PRINT,
149 /*	X		Y		Z		[	*/
150 CASE_PRINT,
151 CASE_PRINT,
152 CASE_PRINT,
153 CASE_PRINT,
154 /*	\		]		^		_	*/
155 CASE_PRINT,
156 CASE_PRINT,
157 CASE_PRINT,
158 CASE_PRINT,
159 /*	`		a		b		c	*/
160 CASE_PRINT,
161 CASE_PRINT,
162 CASE_PRINT,
163 CASE_PRINT,
164 /*	d		e		f		g	*/
165 CASE_PRINT,
166 CASE_PRINT,
167 CASE_PRINT,
168 CASE_PRINT,
169 /*	h		i		j		k	*/
170 CASE_PRINT,
171 CASE_PRINT,
172 CASE_PRINT,
173 CASE_PRINT,
174 /*	l		m		n		o	*/
175 CASE_PRINT,
176 CASE_PRINT,
177 CASE_PRINT,
178 CASE_PRINT,
179 /*	p		q		r		s	*/
180 CASE_PRINT,
181 CASE_PRINT,
182 CASE_PRINT,
183 CASE_PRINT,
184 /*	t		u		v		w	*/
185 CASE_PRINT,
186 CASE_PRINT,
187 CASE_PRINT,
188 CASE_PRINT,
189 /*	x		y		z		{	*/
190 CASE_PRINT,
191 CASE_PRINT,
192 CASE_PRINT,
193 CASE_PRINT,
194 /*	|		}		~		DEL	*/
195 CASE_PRINT,
196 CASE_PRINT,
197 CASE_PRINT,
198 CASE_IGNORE,
199 /*      0x80            0x81            0x82            0x83    */
200 CASE_UTF8_INSTRING,
201 CASE_UTF8_INSTRING,
202 CASE_UTF8_INSTRING,
203 CASE_UTF8_INSTRING,
204 /*      0x84            0x85            0x86            0x87    */
205 CASE_UTF8_INSTRING,
206 CASE_UTF8_INSTRING,
207 CASE_UTF8_INSTRING,
208 CASE_UTF8_INSTRING,
209 /*      0x88            0x89            0x8a            0x8b    */
210 CASE_UTF8_INSTRING,
211 CASE_UTF8_INSTRING,
212 CASE_UTF8_INSTRING,
213 CASE_UTF8_INSTRING,
214 /*      0x8c            0x8d            0x8e            0x8f    */
215 CASE_UTF8_INSTRING,
216 CASE_UTF8_INSTRING,
217 CASE_UTF8_INSTRING,
218 CASE_UTF8_INSTRING,
219 /*      0x90            0x91            0x92            0x93    */
220 CASE_UTF8_INSTRING,
221 CASE_UTF8_INSTRING,
222 CASE_UTF8_INSTRING,
223 CASE_UTF8_INSTRING,
224 /*      0x94            0x95            0x96            0x97    */
225 CASE_UTF8_INSTRING,
226 CASE_UTF8_INSTRING,
227 CASE_UTF8_INSTRING,
228 CASE_UTF8_INSTRING,
229 /*      0x99            0x99            0x9a            0x9b    */
230 CASE_UTF8_INSTRING,
231 CASE_UTF8_INSTRING,
232 CASE_UTF8_INSTRING,
233 CASE_UTF8_INSTRING,
234 /*      0x9c            0x9d            0x9e            0x9f    */
235 CASE_UTF8_INSTRING,
236 CASE_UTF8_INSTRING,
237 CASE_UTF8_INSTRING,
238 CASE_UTF8_INSTRING,
239 /*      0xa0		0xa1		0xa2		0xa3	*/
240 CASE_UTF8_INSTRING,
241 CASE_UTF8_INSTRING,
242 CASE_UTF8_INSTRING,
243 CASE_UTF8_INSTRING,
244 /*      0xa4		0xa5		0xa6		0xa7	*/
245 CASE_UTF8_INSTRING,
246 CASE_UTF8_INSTRING,
247 CASE_UTF8_INSTRING,
248 CASE_UTF8_INSTRING,
249 /*      0xa8		0xa9		0xaa		0xab	*/
250 CASE_UTF8_INSTRING,
251 CASE_UTF8_INSTRING,
252 CASE_UTF8_INSTRING,
253 CASE_UTF8_INSTRING,
254 /*      0xac		0xad		0xae		0xaf	*/
255 CASE_UTF8_INSTRING,
256 CASE_UTF8_INSTRING,
257 CASE_UTF8_INSTRING,
258 CASE_UTF8_INSTRING,
259 /*      0xb0		0xb1		0xb2		0xb3	*/
260 CASE_UTF8_INSTRING,
261 CASE_UTF8_INSTRING,
262 CASE_UTF8_INSTRING,
263 CASE_UTF8_INSTRING,
264 /*      0xb4		0xb5		0xb6		0xb7	*/
265 CASE_UTF8_INSTRING,
266 CASE_UTF8_INSTRING,
267 CASE_UTF8_INSTRING,
268 CASE_UTF8_INSTRING,
269 /*      0xb8		0xb9		0xba		0xbb	*/
270 CASE_UTF8_INSTRING,
271 CASE_UTF8_INSTRING,
272 CASE_UTF8_INSTRING,
273 CASE_UTF8_INSTRING,
274 /*      0xbc		0xbd		0xbe		0xbf	*/
275 CASE_UTF8_INSTRING,
276 CASE_UTF8_INSTRING,
277 CASE_UTF8_INSTRING,
278 CASE_UTF8_INSTRING,
279 /*      0xc0		0xc1		0xc2		0xc3	*/
280 CASE_UTF8_2BYTE,
281 CASE_UTF8_2BYTE,
282 CASE_UTF8_2BYTE,
283 CASE_UTF8_2BYTE,
284 /*      0xc4		0xc5		0xc6		0xc7	*/
285 CASE_UTF8_2BYTE,
286 CASE_UTF8_2BYTE,
287 CASE_UTF8_2BYTE,
288 CASE_UTF8_2BYTE,
289 /*      0xc8		0xc9		0xca		0xcb	*/
290 CASE_UTF8_2BYTE,
291 CASE_UTF8_2BYTE,
292 CASE_UTF8_2BYTE,
293 CASE_UTF8_2BYTE,
294 /*      0xcc		0xcd		0xce		0xcf	*/
295 CASE_UTF8_2BYTE,
296 CASE_UTF8_2BYTE,
297 CASE_UTF8_2BYTE,
298 CASE_UTF8_2BYTE,
299 /*      0xd0		0xd1		0xd2		0xd3	*/
300 CASE_UTF8_2BYTE,
301 CASE_UTF8_2BYTE,
302 CASE_UTF8_2BYTE,
303 CASE_UTF8_2BYTE,
304 /*      0xd4		0xd5		0xd6		0xd7	*/
305 CASE_UTF8_2BYTE,
306 CASE_UTF8_2BYTE,
307 CASE_UTF8_2BYTE,
308 CASE_UTF8_2BYTE,
309 /*      0xd8		0xd9		0xda		0xdb	*/
310 CASE_UTF8_2BYTE,
311 CASE_UTF8_2BYTE,
312 CASE_UTF8_2BYTE,
313 CASE_UTF8_2BYTE,
314 /*      0xdc		0xdd		0xde		0xdf	*/
315 CASE_UTF8_2BYTE,
316 CASE_UTF8_2BYTE,
317 CASE_UTF8_2BYTE,
318 CASE_UTF8_2BYTE,
319 /*      0xe0		0xe1		0xe2		0xe3	*/
320 CASE_UTF8_3BYTE,
321 CASE_UTF8_3BYTE,
322 CASE_UTF8_3BYTE,
323 CASE_UTF8_3BYTE,
324 /*      0xe4		0xe5		0xe6		0xe7	*/
325 CASE_UTF8_3BYTE,
326 CASE_UTF8_3BYTE,
327 CASE_UTF8_3BYTE,
328 CASE_UTF8_3BYTE,
329 /*      0xe8		0xe9		0xea		0xeb	*/
330 CASE_UTF8_3BYTE,
331 CASE_UTF8_3BYTE,
332 CASE_UTF8_3BYTE,
333 CASE_UTF8_3BYTE,
334 /*      0xec		0xed		0xee		0xef	*/
335 CASE_UTF8_3BYTE,
336 CASE_UTF8_3BYTE,
337 CASE_UTF8_3BYTE,
338 CASE_UTF8_3BYTE,
339 /*      0xf0		0xf1		0xf2		0xf3	*/
340 CASE_UTF8_3BYTE,
341 CASE_UTF8_3BYTE,
342 CASE_UTF8_3BYTE,
343 CASE_UTF8_3BYTE,
344 /*      0xf4		0xf5		0xf6		0xf7	*/
345 CASE_UTF8_3BYTE,
346 CASE_UTF8_3BYTE,
347 CASE_UTF8_3BYTE,
348 CASE_UTF8_3BYTE,
349 /*      0xf8		0xf9		0xfa		0xfb	*/
350 CASE_UTF8_3BYTE,
351 CASE_UTF8_3BYTE,
352 CASE_UTF8_3BYTE,
353 CASE_UTF8_3BYTE,
354 /*      0xfc		0xfd		0xfe		0xff	*/
355 CASE_UTF8_3BYTE,
356 CASE_UTF8_3BYTE,
357 CASE_UTF8_3BYTE,
358 CASE_UTF8_3BYTE,
359 };
360 
361 // #pragma mark charset 96 table
362 int gCS96GroundTable[] =
363 {
364 /*	NUL		SOH		STX		ETX	*/
365 CASE_IGNORE,
366 CASE_IGNORE,
367 CASE_IGNORE,
368 CASE_IGNORE,
369 /*	EOT		ENQ		ACK		BEL	*/
370 CASE_IGNORE,
371 CASE_IGNORE,
372 CASE_IGNORE,
373 CASE_BELL,
374 /*	BS		HT		NL		VT	*/
375 CASE_BS,
376 CASE_TAB,
377 CASE_LF,
378 CASE_LF, /* CASE_UP*/
379 /*	NP		CR		SO		SI	*/
380 CASE_LF, /* CASE_IGNORE*/
381 CASE_CR,
382 CASE_SO,
383 CASE_SI,
384 /*	DLE		DC1		DC2		DC3	*/
385 CASE_IGNORE,
386 CASE_IGNORE,
387 CASE_IGNORE,
388 CASE_IGNORE,
389 /*	DC4		NAK		SYN		ETB	*/
390 CASE_IGNORE,
391 CASE_IGNORE,
392 CASE_IGNORE,
393 CASE_IGNORE,
394 /*	CAN		EM		SUB		ESC	*/
395 CASE_IGNORE,
396 CASE_IGNORE,
397 CASE_IGNORE,
398 CASE_ESC,
399 /*	FS		GS		RS		US	*/
400 CASE_IGNORE,
401 CASE_IGNORE,
402 CASE_IGNORE,
403 CASE_IGNORE,
404 /*	SP		!		"		#	*/
405 CASE_PRINT_CS96,
406 CASE_PRINT_CS96,
407 CASE_PRINT_CS96,
408 CASE_PRINT_CS96,
409 /*	$		%		&		'	*/
410 CASE_PRINT_CS96,
411 CASE_PRINT_CS96,
412 CASE_PRINT_CS96,
413 CASE_PRINT_CS96,
414 /*	(		)		*		+	*/
415 CASE_PRINT_CS96,
416 CASE_PRINT_CS96,
417 CASE_PRINT_CS96,
418 CASE_PRINT_CS96,
419 /*	,		-		.		/	*/
420 CASE_PRINT_CS96,
421 CASE_PRINT_CS96,
422 CASE_PRINT_CS96,
423 CASE_PRINT_CS96,
424 /*	0		1		2		3	*/
425 CASE_PRINT_CS96,
426 CASE_PRINT_CS96,
427 CASE_PRINT_CS96,
428 CASE_PRINT_CS96,
429 /*	4		5		6		7	*/
430 CASE_PRINT_CS96,
431 CASE_PRINT_CS96,
432 CASE_PRINT_CS96,
433 CASE_PRINT_CS96,
434 /*	8		9		:		;	*/
435 CASE_PRINT_CS96,
436 CASE_PRINT_CS96,
437 CASE_PRINT_CS96,
438 CASE_PRINT_CS96,
439 /*	<		=		>		?	*/
440 CASE_PRINT_CS96,
441 CASE_PRINT_CS96,
442 CASE_PRINT_CS96,
443 CASE_PRINT_CS96,
444 /*	@		A		B		C	*/
445 CASE_PRINT_CS96,
446 CASE_PRINT_CS96,
447 CASE_PRINT_CS96,
448 CASE_PRINT_CS96,
449 /*	D		E		F		G	*/
450 CASE_PRINT_CS96,
451 CASE_PRINT_CS96,
452 CASE_PRINT_CS96,
453 CASE_PRINT_CS96,
454 /*	H		I		J		K	*/
455 CASE_PRINT_CS96,
456 CASE_PRINT_CS96,
457 CASE_PRINT_CS96,
458 CASE_PRINT_CS96,
459 /*	L		M		N		O	*/
460 CASE_PRINT_CS96,
461 CASE_PRINT_CS96,
462 CASE_PRINT_CS96,
463 CASE_PRINT_CS96,
464 /*	P		Q		R		S	*/
465 CASE_PRINT_CS96,
466 CASE_PRINT_CS96,
467 CASE_PRINT_CS96,
468 CASE_PRINT_CS96,
469 /*	T		U		V		W	*/
470 CASE_PRINT_CS96,
471 CASE_PRINT_CS96,
472 CASE_PRINT_CS96,
473 CASE_PRINT_CS96,
474 /*	X		Y		Z		[	*/
475 CASE_PRINT_CS96,
476 CASE_PRINT_CS96,
477 CASE_PRINT_CS96,
478 CASE_PRINT_CS96,
479 /*	\		]		^		_	*/
480 CASE_PRINT_CS96,
481 CASE_PRINT_CS96,
482 CASE_PRINT_CS96,
483 CASE_PRINT_CS96,
484 /*	`		a		b		c	*/
485 CASE_PRINT_CS96,
486 CASE_PRINT_CS96,
487 CASE_PRINT_CS96,
488 CASE_PRINT_CS96,
489 /*	d		e		f		g	*/
490 CASE_PRINT_CS96,
491 CASE_PRINT_CS96,
492 CASE_PRINT_CS96,
493 CASE_PRINT_CS96,
494 /*	h		i		j		k	*/
495 CASE_PRINT_CS96,
496 CASE_PRINT_CS96,
497 CASE_PRINT_CS96,
498 CASE_PRINT_CS96,
499 /*	l		m		n		o	*/
500 CASE_PRINT_CS96,
501 CASE_PRINT_CS96,
502 CASE_PRINT_CS96,
503 CASE_PRINT_CS96,
504 /*	p		q		r		s	*/
505 CASE_PRINT_CS96,
506 CASE_PRINT_CS96,
507 CASE_PRINT_CS96,
508 CASE_PRINT_CS96,
509 /*	t		u		v		w	*/
510 CASE_PRINT_CS96,
511 CASE_PRINT_CS96,
512 CASE_PRINT_CS96,
513 CASE_PRINT_CS96,
514 /*	x		y		z		{	*/
515 CASE_PRINT_CS96,
516 CASE_PRINT_CS96,
517 CASE_PRINT_CS96,
518 CASE_PRINT_CS96,
519 /*	|		}		~		DEL	*/
520 CASE_PRINT_CS96,
521 CASE_PRINT_CS96,
522 CASE_PRINT_CS96,
523 CASE_PRINT_CS96,
524 /*      0x80            0x81            0x82            0x83    */
525 CASE_IGNORE,
526 CASE_IGNORE,
527 CASE_IGNORE,
528 CASE_IGNORE,
529 /*      0x84            0x85            0x86            0x87    */
530 CASE_IGNORE,
531 CASE_IGNORE,
532 CASE_IGNORE,
533 CASE_IGNORE,
534 /*      0x88            0x89            0x8a            0x8b    */
535 CASE_IGNORE,
536 CASE_IGNORE,
537 CASE_IGNORE,
538 CASE_IGNORE,
539 /*      0x8c            0x8d            0x8e            0x8f    */
540 CASE_IGNORE,
541 CASE_IGNORE,
542 CASE_IGNORE,
543 CASE_IGNORE,
544 /*      0x90            0x91            0x92            0x93    */
545 CASE_IGNORE,
546 CASE_IGNORE,
547 CASE_IGNORE,
548 CASE_IGNORE,
549 /*      0x94            0x95            0x96            0x97    */
550 CASE_IGNORE,
551 CASE_IGNORE,
552 CASE_IGNORE,
553 CASE_IGNORE,
554 /*      0x99            0x99            0x9a            0x9b    */
555 CASE_IGNORE,
556 CASE_IGNORE,
557 CASE_IGNORE,
558 CASE_IGNORE,
559 /*      0x9c            0x9d            0x9e            0x9f    */
560 CASE_IGNORE,
561 CASE_IGNORE,
562 CASE_IGNORE,
563 CASE_IGNORE,
564 /*      0xa0		0xa1		0xa2		0xa3	*/
565 CASE_IGNORE,
566 CASE_IGNORE,
567 CASE_IGNORE,
568 CASE_IGNORE,
569 /*      0xa4		0xa5		0xa6		0xa7	*/
570 CASE_IGNORE,
571 CASE_IGNORE,
572 CASE_IGNORE,
573 CASE_IGNORE,
574 /*      0xa8		0xa9		0xaa		0xab	*/
575 CASE_IGNORE,
576 CASE_IGNORE,
577 CASE_IGNORE,
578 CASE_IGNORE,
579 /*      0xac		0xad		0xae		0xaf	*/
580 CASE_IGNORE,
581 CASE_IGNORE,
582 CASE_IGNORE,
583 CASE_IGNORE,
584 /*      0xb0		0xb1		0xb2		0xb3	*/
585 CASE_IGNORE,
586 CASE_IGNORE,
587 CASE_IGNORE,
588 CASE_IGNORE,
589 /*      0xb4		0xb5		0xb6		0xb7	*/
590 CASE_IGNORE,
591 CASE_IGNORE,
592 CASE_IGNORE,
593 CASE_IGNORE,
594 /*      0xb8		0xb9		0xba		0xbb	*/
595 CASE_IGNORE,
596 CASE_IGNORE,
597 CASE_IGNORE,
598 CASE_IGNORE,
599 /*      0xbc		0xbd		0xbe		0xbf	*/
600 CASE_IGNORE,
601 CASE_IGNORE,
602 CASE_IGNORE,
603 CASE_IGNORE,
604 /*      0xc0		0xc1		0xc2		0xc3	*/
605 CASE_IGNORE,
606 CASE_IGNORE,
607 CASE_IGNORE,
608 CASE_IGNORE,
609 /*      0xc4		0xc5		0xc6		0xc7	*/
610 CASE_IGNORE,
611 CASE_IGNORE,
612 CASE_IGNORE,
613 CASE_IGNORE,
614 /*      0xc8		0xc9		0xca		0xcb	*/
615 CASE_IGNORE,
616 CASE_IGNORE,
617 CASE_IGNORE,
618 CASE_IGNORE,
619 /*      0xcc		0xcd		0xce		0xcf	*/
620 CASE_IGNORE,
621 CASE_IGNORE,
622 CASE_IGNORE,
623 CASE_IGNORE,
624 /*      0xd0		0xd1		0xd2		0xd3	*/
625 CASE_IGNORE,
626 CASE_IGNORE,
627 CASE_IGNORE,
628 CASE_IGNORE,
629 /*      0xd4		0xd5		0xd6		0xd7	*/
630 CASE_IGNORE,
631 CASE_IGNORE,
632 CASE_IGNORE,
633 CASE_IGNORE,
634 /*      0xd8		0xd9		0xda		0xdb	*/
635 CASE_IGNORE,
636 CASE_IGNORE,
637 CASE_IGNORE,
638 CASE_IGNORE,
639 /*      0xdc		0xdd		0xde		0xdf	*/
640 CASE_IGNORE,
641 CASE_IGNORE,
642 CASE_IGNORE,
643 CASE_IGNORE,
644 /*      0xe0		0xe1		0xe2		0xe3	*/
645 CASE_IGNORE,
646 CASE_IGNORE,
647 CASE_IGNORE,
648 CASE_IGNORE,
649 /*      0xe4		0xe5		0xe6		0xe7	*/
650 CASE_IGNORE,
651 CASE_IGNORE,
652 CASE_IGNORE,
653 CASE_IGNORE,
654 /*      0xe8		0xe9		0xea		0xeb	*/
655 CASE_IGNORE,
656 CASE_IGNORE,
657 CASE_IGNORE,
658 CASE_IGNORE,
659 /*      0xec		0xed		0xee		0xef	*/
660 CASE_IGNORE,
661 CASE_IGNORE,
662 CASE_IGNORE,
663 CASE_IGNORE,
664 /*      0xf0		0xf1		0xf2		0xf3	*/
665 CASE_IGNORE,
666 CASE_IGNORE,
667 CASE_IGNORE,
668 CASE_IGNORE,
669 /*      0xf4		0xf5		0xf6		0xf7	*/
670 CASE_IGNORE,
671 CASE_IGNORE,
672 CASE_IGNORE,
673 CASE_IGNORE,
674 /*      0xf8		0xf9		0xfa		0xfb	*/
675 CASE_IGNORE,
676 CASE_IGNORE,
677 CASE_IGNORE,
678 CASE_IGNORE,
679 /*      0xfc		0xfd		0xfe		0xff	*/
680 CASE_IGNORE,
681 CASE_IGNORE,
682 CASE_IGNORE,
683 CASE_IGNORE,
684 };
685 
686 // #pragma mark ISO8859 table
687 int gISO8859GroundTable[] =
688 {
689 /*	NUL		SOH		STX		ETX	*/
690 CASE_IGNORE,
691 CASE_IGNORE,
692 CASE_IGNORE,
693 CASE_IGNORE,
694 /*	EOT		ENQ		ACK		BEL	*/
695 CASE_IGNORE,
696 CASE_IGNORE,
697 CASE_IGNORE,
698 CASE_BELL,
699 /*	BS		HT		NL		VT	*/
700 CASE_BS,
701 CASE_TAB,
702 CASE_LF,
703 CASE_LF, /*CASE_UP,*/
704 /*	NP		CR		SO		SI	*/
705 CASE_LF, /*CASE_IGNORE,*/
706 CASE_CR,
707 CASE_SO,
708 CASE_SI,
709 /*	DLE		DC1		DC2		DC3	*/
710 CASE_IGNORE,
711 CASE_IGNORE,
712 CASE_IGNORE,
713 CASE_IGNORE,
714 /*	DC4		NAK		SYN		ETB	*/
715 CASE_IGNORE,
716 CASE_IGNORE,
717 CASE_IGNORE,
718 CASE_IGNORE,
719 /*	CAN		EM		SUB		ESC	*/
720 CASE_IGNORE,
721 CASE_IGNORE,
722 CASE_IGNORE,
723 CASE_ESC,
724 /*	FS		GS		RS		US	*/
725 CASE_IGNORE,
726 CASE_IGNORE,
727 CASE_IGNORE,
728 CASE_IGNORE,
729 /*	SP		!		"		#	*/
730 CASE_PRINT,
731 CASE_PRINT,
732 CASE_PRINT,
733 CASE_PRINT,
734 /*	$		%		&		'	*/
735 CASE_PRINT,
736 CASE_PRINT,
737 CASE_PRINT,
738 CASE_PRINT,
739 /*	(		)		*		+	*/
740 CASE_PRINT,
741 CASE_PRINT,
742 CASE_PRINT,
743 CASE_PRINT,
744 /*	,		-		.		/	*/
745 CASE_PRINT,
746 CASE_PRINT,
747 CASE_PRINT,
748 CASE_PRINT,
749 /*	0		1		2		3	*/
750 CASE_PRINT,
751 CASE_PRINT,
752 CASE_PRINT,
753 CASE_PRINT,
754 /*	4		5		6		7	*/
755 CASE_PRINT,
756 CASE_PRINT,
757 CASE_PRINT,
758 CASE_PRINT,
759 /*	8		9		:		;	*/
760 CASE_PRINT,
761 CASE_PRINT,
762 CASE_PRINT,
763 CASE_PRINT,
764 /*	<		=		>		?	*/
765 CASE_PRINT,
766 CASE_PRINT,
767 CASE_PRINT,
768 CASE_PRINT,
769 /*	@		A		B		C	*/
770 CASE_PRINT,
771 CASE_PRINT,
772 CASE_PRINT,
773 CASE_PRINT,
774 /*	D		E		F		G	*/
775 CASE_PRINT,
776 CASE_PRINT,
777 CASE_PRINT,
778 CASE_PRINT,
779 /*	H		I		J		K	*/
780 CASE_PRINT,
781 CASE_PRINT,
782 CASE_PRINT,
783 CASE_PRINT,
784 /*	L		M		N		O	*/
785 CASE_PRINT,
786 CASE_PRINT,
787 CASE_PRINT,
788 CASE_PRINT,
789 /*	P		Q		R		S	*/
790 CASE_PRINT,
791 CASE_PRINT,
792 CASE_PRINT,
793 CASE_PRINT,
794 /*	T		U		V		W	*/
795 CASE_PRINT,
796 CASE_PRINT,
797 CASE_PRINT,
798 CASE_PRINT,
799 /*	X		Y		Z		[	*/
800 CASE_PRINT,
801 CASE_PRINT,
802 CASE_PRINT,
803 CASE_PRINT,
804 /*	\		]		^		_	*/
805 CASE_PRINT,
806 CASE_PRINT,
807 CASE_PRINT,
808 CASE_PRINT,
809 /*	`		a		b		c	*/
810 CASE_PRINT,
811 CASE_PRINT,
812 CASE_PRINT,
813 CASE_PRINT,
814 /*	d		e		f		g	*/
815 CASE_PRINT,
816 CASE_PRINT,
817 CASE_PRINT,
818 CASE_PRINT,
819 /*	h		i		j		k	*/
820 CASE_PRINT,
821 CASE_PRINT,
822 CASE_PRINT,
823 CASE_PRINT,
824 /*	l		m		n		o	*/
825 CASE_PRINT,
826 CASE_PRINT,
827 CASE_PRINT,
828 CASE_PRINT,
829 /*	p		q		r		s	*/
830 CASE_PRINT,
831 CASE_PRINT,
832 CASE_PRINT,
833 CASE_PRINT,
834 /*	t		u		v		w	*/
835 CASE_PRINT,
836 CASE_PRINT,
837 CASE_PRINT,
838 CASE_PRINT,
839 /*	x		y		z		{	*/
840 CASE_PRINT,
841 CASE_PRINT,
842 CASE_PRINT,
843 CASE_PRINT,
844 /*	|		}		~		DEL	*/
845 CASE_PRINT,
846 CASE_PRINT,
847 CASE_PRINT,
848 CASE_PRINT,
849 /*      0x80            0x81            0x82            0x83    */
850 CASE_IGNORE,
851 CASE_IGNORE,
852 CASE_IGNORE,
853 CASE_IGNORE,
854 /*      0x84            0x85            0x86            0x87    */
855 CASE_IGNORE,
856 CASE_IGNORE,
857 CASE_IGNORE,
858 CASE_IGNORE,
859 /*      0x88            0x89            0x8a            0x8b    */
860 CASE_IGNORE,
861 CASE_IGNORE,
862 CASE_IGNORE,
863 CASE_IGNORE,
864 /*      0x8c            0x8d            0x8e            0x8f    */
865 CASE_IGNORE,
866 CASE_IGNORE,
867 CASE_SS2,
868 CASE_SS3,
869 /*      0x90            0x91            0x92            0x93    */
870 CASE_IGNORE,
871 CASE_IGNORE,
872 CASE_IGNORE,
873 CASE_IGNORE,
874 /*      0x94            0x95            0x96            0x97    */
875 CASE_IGNORE,
876 CASE_IGNORE,
877 CASE_IGNORE,
878 CASE_IGNORE,
879 /*      0x99            0x99            0x9a            0x9b    */
880 CASE_IGNORE,
881 CASE_IGNORE,
882 CASE_IGNORE,
883 CASE_CSI_STATE,
884 /*      0x9c            0x9d            0x9e            0x9f    */
885 CASE_IGNORE,
886 CASE_IGNORE,
887 CASE_IGNORE,
888 CASE_IGNORE,
889 /*      nobreakspace    exclamdown      cent            sterling        */
890 CASE_PRINT_GR,
891 CASE_PRINT_GR,
892 CASE_PRINT_GR,
893 CASE_PRINT_GR,
894 /*      currency        yen             brokenbar       section         */
895 CASE_PRINT_GR,
896 CASE_PRINT_GR,
897 CASE_PRINT_GR,
898 CASE_PRINT_GR,
899 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
900 CASE_PRINT_GR,
901 CASE_PRINT_GR,
902 CASE_PRINT_GR,
903 CASE_PRINT_GR,
904 /*      notsign         hyphen          registered      macron          */
905 CASE_PRINT_GR,
906 CASE_PRINT_GR,
907 CASE_PRINT_GR,
908 CASE_PRINT_GR,
909 /*      degree          plusminus       twosuperior     threesuperior   */
910 CASE_PRINT_GR,
911 CASE_PRINT_GR,
912 CASE_PRINT_GR,
913 CASE_PRINT_GR,
914 /*      acute           mu              paragraph       periodcentered  */
915 CASE_PRINT_GR,
916 CASE_PRINT_GR,
917 CASE_PRINT_GR,
918 CASE_PRINT_GR,
919 /*      cedilla         onesuperior     masculine       guillemotright  */
920 CASE_PRINT_GR,
921 CASE_PRINT_GR,
922 CASE_PRINT_GR,
923 CASE_PRINT_GR,
924 /*      onequarter      onehalf         threequarters   questiondown    */
925 CASE_PRINT_GR,
926 CASE_PRINT_GR,
927 CASE_PRINT_GR,
928 CASE_PRINT_GR,
929 /*      Agrave          Aacute          Acircumflex     Atilde          */
930 CASE_PRINT_GR,
931 CASE_PRINT_GR,
932 CASE_PRINT_GR,
933 CASE_PRINT_GR,
934 /*      Adiaeresis      Aring           AE              Ccedilla        */
935 CASE_PRINT_GR,
936 CASE_PRINT_GR,
937 CASE_PRINT_GR,
938 CASE_PRINT_GR,
939 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
940 CASE_PRINT_GR,
941 CASE_PRINT_GR,
942 CASE_PRINT_GR,
943 CASE_PRINT_GR,
944 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
945 CASE_PRINT_GR,
946 CASE_PRINT_GR,
947 CASE_PRINT_GR,
948 CASE_PRINT_GR,
949 /*      Eth             Ntilde          Ograve          Oacute          */
950 CASE_PRINT_GR,
951 CASE_PRINT_GR,
952 CASE_PRINT_GR,
953 CASE_PRINT_GR,
954 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
955 CASE_PRINT_GR,
956 CASE_PRINT_GR,
957 CASE_PRINT_GR,
958 CASE_PRINT_GR,
959 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
960 CASE_PRINT_GR,
961 CASE_PRINT_GR,
962 CASE_PRINT_GR,
963 CASE_PRINT_GR,
964 /*      Udiaeresis      Yacute          Thorn           ssharp          */
965 CASE_PRINT_GR,
966 CASE_PRINT_GR,
967 CASE_PRINT_GR,
968 CASE_PRINT_GR,
969 /*      agrave          aacute          acircumflex     atilde          */
970 CASE_PRINT_GR,
971 CASE_PRINT_GR,
972 CASE_PRINT_GR,
973 CASE_PRINT_GR,
974 /*      adiaeresis      aring           ae              ccedilla        */
975 CASE_PRINT_GR,
976 CASE_PRINT_GR,
977 CASE_PRINT_GR,
978 CASE_PRINT_GR,
979 /*      egrave          eacute          ecircumflex     ediaeresis      */
980 CASE_PRINT_GR,
981 CASE_PRINT_GR,
982 CASE_PRINT_GR,
983 CASE_PRINT_GR,
984 /*      igrave          iacute          icircumflex     idiaeresis      */
985 CASE_PRINT_GR,
986 CASE_PRINT_GR,
987 CASE_PRINT_GR,
988 CASE_PRINT_GR,
989 /*      eth             ntilde          ograve          oacute          */
990 CASE_PRINT_GR,
991 CASE_PRINT_GR,
992 CASE_PRINT_GR,
993 CASE_PRINT_GR,
994 /*      ocircumflex     otilde          odiaeresis      division        */
995 CASE_PRINT_GR,
996 CASE_PRINT_GR,
997 CASE_PRINT_GR,
998 CASE_PRINT_GR,
999 /*      oslash          ugrave          uacute          ucircumflex     */
1000 CASE_PRINT_GR,
1001 CASE_PRINT_GR,
1002 CASE_PRINT_GR,
1003 CASE_PRINT_GR,
1004 /*      udiaeresis      yacute          thorn           ydiaeresis      */
1005 CASE_PRINT_GR,
1006 CASE_PRINT_GR,
1007 CASE_PRINT_GR,
1008 CASE_PRINT_GR,
1009 };
1010 
1011 // #pragma mark WinCP table (Windows cp1252, cp1251, koi-8r etc.)
1012 int gWinCPGroundTable[] =
1013 {
1014 /*	NUL		SOH		STX		ETX	*/
1015 CASE_IGNORE,
1016 CASE_IGNORE,
1017 CASE_IGNORE,
1018 CASE_IGNORE,
1019 /*	EOT		ENQ		ACK		BEL	*/
1020 CASE_IGNORE,
1021 CASE_IGNORE,
1022 CASE_IGNORE,
1023 CASE_BELL,
1024 /*	BS		HT		NL		VT	*/
1025 CASE_BS,
1026 CASE_TAB,
1027 CASE_LF,
1028 CASE_LF, /*CASE_UP,*/
1029 /*	NP		CR		SO		SI	*/
1030 CASE_LF, /*CASE_IGNORE,*/
1031 CASE_CR,
1032 CASE_SO,
1033 CASE_SI,
1034 /*	DLE		DC1		DC2		DC3	*/
1035 CASE_IGNORE,
1036 CASE_IGNORE,
1037 CASE_IGNORE,
1038 CASE_IGNORE,
1039 /*	DC4		NAK		SYN		ETB	*/
1040 CASE_IGNORE,
1041 CASE_IGNORE,
1042 CASE_IGNORE,
1043 CASE_IGNORE,
1044 /*	CAN		EM		SUB		ESC	*/
1045 CASE_IGNORE,
1046 CASE_IGNORE,
1047 CASE_IGNORE,
1048 CASE_ESC,
1049 /*	FS		GS		RS		US	*/
1050 CASE_IGNORE,
1051 CASE_IGNORE,
1052 CASE_IGNORE,
1053 CASE_IGNORE,
1054 /*	SP		!		"		#	*/
1055 CASE_PRINT,
1056 CASE_PRINT,
1057 CASE_PRINT,
1058 CASE_PRINT,
1059 /*	$		%		&		'	*/
1060 CASE_PRINT,
1061 CASE_PRINT,
1062 CASE_PRINT,
1063 CASE_PRINT,
1064 /*	(		)		*		+	*/
1065 CASE_PRINT,
1066 CASE_PRINT,
1067 CASE_PRINT,
1068 CASE_PRINT,
1069 /*	,		-		.		/	*/
1070 CASE_PRINT,
1071 CASE_PRINT,
1072 CASE_PRINT,
1073 CASE_PRINT,
1074 /*	0		1		2		3	*/
1075 CASE_PRINT,
1076 CASE_PRINT,
1077 CASE_PRINT,
1078 CASE_PRINT,
1079 /*	4		5		6		7	*/
1080 CASE_PRINT,
1081 CASE_PRINT,
1082 CASE_PRINT,
1083 CASE_PRINT,
1084 /*	8		9		:		;	*/
1085 CASE_PRINT,
1086 CASE_PRINT,
1087 CASE_PRINT,
1088 CASE_PRINT,
1089 /*	<		=		>		?	*/
1090 CASE_PRINT,
1091 CASE_PRINT,
1092 CASE_PRINT,
1093 CASE_PRINT,
1094 /*	@		A		B		C	*/
1095 CASE_PRINT,
1096 CASE_PRINT,
1097 CASE_PRINT,
1098 CASE_PRINT,
1099 /*	D		E		F		G	*/
1100 CASE_PRINT,
1101 CASE_PRINT,
1102 CASE_PRINT,
1103 CASE_PRINT,
1104 /*	H		I		J		K	*/
1105 CASE_PRINT,
1106 CASE_PRINT,
1107 CASE_PRINT,
1108 CASE_PRINT,
1109 /*	L		M		N		O	*/
1110 CASE_PRINT,
1111 CASE_PRINT,
1112 CASE_PRINT,
1113 CASE_PRINT,
1114 /*	P		Q		R		S	*/
1115 CASE_PRINT,
1116 CASE_PRINT,
1117 CASE_PRINT,
1118 CASE_PRINT,
1119 /*	T		U		V		W	*/
1120 CASE_PRINT,
1121 CASE_PRINT,
1122 CASE_PRINT,
1123 CASE_PRINT,
1124 /*	X		Y		Z		[	*/
1125 CASE_PRINT,
1126 CASE_PRINT,
1127 CASE_PRINT,
1128 CASE_PRINT,
1129 /*	\		]		^		_	*/
1130 CASE_PRINT,
1131 CASE_PRINT,
1132 CASE_PRINT,
1133 CASE_PRINT,
1134 /*	`		a		b		c	*/
1135 CASE_PRINT,
1136 CASE_PRINT,
1137 CASE_PRINT,
1138 CASE_PRINT,
1139 /*	d		e		f		g	*/
1140 CASE_PRINT,
1141 CASE_PRINT,
1142 CASE_PRINT,
1143 CASE_PRINT,
1144 /*	h		i		j		k	*/
1145 CASE_PRINT,
1146 CASE_PRINT,
1147 CASE_PRINT,
1148 CASE_PRINT,
1149 /*	l		m		n		o	*/
1150 CASE_PRINT,
1151 CASE_PRINT,
1152 CASE_PRINT,
1153 CASE_PRINT,
1154 /*	p		q		r		s	*/
1155 CASE_PRINT,
1156 CASE_PRINT,
1157 CASE_PRINT,
1158 CASE_PRINT,
1159 /*	t		u		v		w	*/
1160 CASE_PRINT,
1161 CASE_PRINT,
1162 CASE_PRINT,
1163 CASE_PRINT,
1164 /*	x		y		z		{	*/
1165 CASE_PRINT,
1166 CASE_PRINT,
1167 CASE_PRINT,
1168 CASE_PRINT,
1169 /*	|		}		~		DEL	*/
1170 CASE_PRINT,
1171 CASE_PRINT,
1172 CASE_PRINT,
1173 CASE_PRINT, //TODO???
1174 /*      0x80            0x81            0x82            0x83    */
1175 CASE_PRINT_GR,
1176 CASE_PRINT_GR,
1177 CASE_PRINT_GR,
1178 CASE_PRINT_GR,
1179 /*      0x84            0x85            0x86            0x87    */
1180 CASE_PRINT_GR,
1181 CASE_PRINT_GR,
1182 CASE_PRINT_GR,
1183 CASE_PRINT_GR,
1184 /*      0x88            0x89            0x8a            0x8b    */
1185 CASE_PRINT_GR,
1186 CASE_PRINT_GR,
1187 CASE_PRINT_GR,
1188 CASE_PRINT_GR,
1189 /*      0x8c            0x8d            0x8e            0x8f    */
1190 CASE_PRINT_GR,
1191 CASE_PRINT_GR,
1192 CASE_PRINT_GR,
1193 CASE_PRINT_GR,
1194 /*      0x90            0x91            0x92            0x93    */
1195 CASE_PRINT_GR,
1196 CASE_PRINT_GR,
1197 CASE_PRINT_GR,
1198 CASE_PRINT_GR,
1199 /*      0x94            0x95            0x96            0x97    */
1200 CASE_PRINT_GR,
1201 CASE_PRINT_GR,
1202 CASE_PRINT_GR,
1203 CASE_PRINT_GR,
1204 /*      0x99            0x99            0x9a            0x9b    */
1205 CASE_PRINT_GR,
1206 CASE_PRINT_GR,
1207 CASE_PRINT_GR,
1208 CASE_PRINT_GR,
1209 /*      0x9c            0x9d            0x9e            0x9f    */
1210 CASE_PRINT_GR,
1211 CASE_PRINT_GR,
1212 CASE_PRINT_GR,
1213 CASE_PRINT_GR,
1214 /*      nobreakspace    exclamdown      cent            sterling        */
1215 CASE_PRINT_GR,
1216 CASE_PRINT_GR,
1217 CASE_PRINT_GR,
1218 CASE_PRINT_GR,
1219 /*      currency        yen             brokenbar       section         */
1220 CASE_PRINT_GR,
1221 CASE_PRINT_GR,
1222 CASE_PRINT_GR,
1223 CASE_PRINT_GR,
1224 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
1225 CASE_PRINT_GR,
1226 CASE_PRINT_GR,
1227 CASE_PRINT_GR,
1228 CASE_PRINT_GR,
1229 /*      notsign         hyphen          registered      macron          */
1230 CASE_PRINT_GR,
1231 CASE_PRINT_GR,
1232 CASE_PRINT_GR,
1233 CASE_PRINT_GR,
1234 /*      degree          plusminus       twosuperior     threesuperior   */
1235 CASE_PRINT_GR,
1236 CASE_PRINT_GR,
1237 CASE_PRINT_GR,
1238 CASE_PRINT_GR,
1239 /*      acute           mu              paragraph       periodcentered  */
1240 CASE_PRINT_GR,
1241 CASE_PRINT_GR,
1242 CASE_PRINT_GR,
1243 CASE_PRINT_GR,
1244 /*      cedilla         onesuperior     masculine       guillemotright  */
1245 CASE_PRINT_GR,
1246 CASE_PRINT_GR,
1247 CASE_PRINT_GR,
1248 CASE_PRINT_GR,
1249 /*      onequarter      onehalf         threequarters   questiondown    */
1250 CASE_PRINT_GR,
1251 CASE_PRINT_GR,
1252 CASE_PRINT_GR,
1253 CASE_PRINT_GR,
1254 /*      Agrave          Aacute          Acircumflex     Atilde          */
1255 CASE_PRINT_GR,
1256 CASE_PRINT_GR,
1257 CASE_PRINT_GR,
1258 CASE_PRINT_GR,
1259 /*      Adiaeresis      Aring           AE              Ccedilla        */
1260 CASE_PRINT_GR,
1261 CASE_PRINT_GR,
1262 CASE_PRINT_GR,
1263 CASE_PRINT_GR,
1264 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
1265 CASE_PRINT_GR,
1266 CASE_PRINT_GR,
1267 CASE_PRINT_GR,
1268 CASE_PRINT_GR,
1269 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
1270 CASE_PRINT_GR,
1271 CASE_PRINT_GR,
1272 CASE_PRINT_GR,
1273 CASE_PRINT_GR,
1274 /*      Eth             Ntilde          Ograve          Oacute          */
1275 CASE_PRINT_GR,
1276 CASE_PRINT_GR,
1277 CASE_PRINT_GR,
1278 CASE_PRINT_GR,
1279 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
1280 CASE_PRINT_GR,
1281 CASE_PRINT_GR,
1282 CASE_PRINT_GR,
1283 CASE_PRINT_GR,
1284 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
1285 CASE_PRINT_GR,
1286 CASE_PRINT_GR,
1287 CASE_PRINT_GR,
1288 CASE_PRINT_GR,
1289 /*      Udiaeresis      Yacute          Thorn           ssharp          */
1290 CASE_PRINT_GR,
1291 CASE_PRINT_GR,
1292 CASE_PRINT_GR,
1293 CASE_PRINT_GR,
1294 /*      agrave          aacute          acircumflex     atilde          */
1295 CASE_PRINT_GR,
1296 CASE_PRINT_GR,
1297 CASE_PRINT_GR,
1298 CASE_PRINT_GR,
1299 /*      adiaeresis      aring           ae              ccedilla        */
1300 CASE_PRINT_GR,
1301 CASE_PRINT_GR,
1302 CASE_PRINT_GR,
1303 CASE_PRINT_GR,
1304 /*      egrave          eacute          ecircumflex     ediaeresis      */
1305 CASE_PRINT_GR,
1306 CASE_PRINT_GR,
1307 CASE_PRINT_GR,
1308 CASE_PRINT_GR,
1309 /*      igrave          iacute          icircumflex     idiaeresis      */
1310 CASE_PRINT_GR,
1311 CASE_PRINT_GR,
1312 CASE_PRINT_GR,
1313 CASE_PRINT_GR,
1314 /*      eth             ntilde          ograve          oacute          */
1315 CASE_PRINT_GR,
1316 CASE_PRINT_GR,
1317 CASE_PRINT_GR,
1318 CASE_PRINT_GR,
1319 /*      ocircumflex     otilde          odiaeresis      division        */
1320 CASE_PRINT_GR,
1321 CASE_PRINT_GR,
1322 CASE_PRINT_GR,
1323 CASE_PRINT_GR,
1324 /*      oslash          ugrave          uacute          ucircumflex     */
1325 CASE_PRINT_GR,
1326 CASE_PRINT_GR,
1327 CASE_PRINT_GR,
1328 CASE_PRINT_GR,
1329 /*      udiaeresis      yacute          thorn           ydiaeresis      */
1330 CASE_PRINT_GR,
1331 CASE_PRINT_GR,
1332 CASE_PRINT_GR,
1333 CASE_PRINT_GR,
1334 };
1335 
1336 // #pragma mark ESC [ - CSI table
1337 int gCsiTable[] =
1338 {
1339 /*	NUL		SOH		STX		ETX	*/
1340 CASE_IGNORE,
1341 CASE_IGNORE,
1342 CASE_IGNORE,
1343 CASE_IGNORE,
1344 /*	EOT		ENQ		ACK		BEL	*/
1345 CASE_IGNORE,
1346 CASE_IGNORE,
1347 CASE_IGNORE,
1348 CASE_BELL,
1349 /*	BS		HT		NL		VT	*/
1350 CASE_BS,
1351 CASE_TAB,
1352 CASE_VMOT,
1353 CASE_VMOT,
1354 /*	NP		CR		SO		SI	*/
1355 CASE_VMOT,
1356 CASE_CR,
1357 CASE_SO,
1358 CASE_SI,
1359 /*	DLE		DC1		DC2		DC3	*/
1360 CASE_IGNORE,
1361 CASE_IGNORE,
1362 CASE_IGNORE,
1363 CASE_IGNORE,
1364 /*	DC4		NAK		SYN		ETB	*/
1365 CASE_IGNORE,
1366 CASE_IGNORE,
1367 CASE_IGNORE,
1368 CASE_IGNORE,
1369 /*	CAN		EM		SUB		ESC	*/
1370 CASE_IGNORE,
1371 CASE_IGNORE,
1372 CASE_IGNORE,
1373 CASE_ESC,
1374 /*	FS		GS		RS		US	*/
1375 CASE_IGNORE,
1376 CASE_IGNORE,
1377 CASE_IGNORE,
1378 CASE_IGNORE,
1379 /*	SP		!		"		#	*/
1380 CASE_ESC_IGNORE,
1381 CASE_ESC_IGNORE,
1382 CASE_ESC_IGNORE,
1383 CASE_ESC_IGNORE,
1384 /*	$		%		&		'	*/
1385 CASE_ESC_IGNORE,
1386 CASE_ESC_IGNORE,
1387 CASE_ESC_IGNORE,
1388 CASE_ESC_IGNORE,
1389 /*	(		)		*		+	*/
1390 CASE_ESC_IGNORE,
1391 CASE_ESC_IGNORE,
1392 CASE_ESC_IGNORE,
1393 CASE_ESC_IGNORE,
1394 /*	,		-		.		/	*/
1395 CASE_ESC_IGNORE,
1396 CASE_ESC_IGNORE,
1397 CASE_ESC_IGNORE,
1398 CASE_ESC_IGNORE,
1399 /*	0		1		2		3	*/
1400 CASE_ESC_DIGIT,
1401 CASE_ESC_DIGIT,
1402 CASE_ESC_DIGIT,
1403 CASE_ESC_DIGIT,
1404 /*	4		5		6		7	*/
1405 CASE_ESC_DIGIT,
1406 CASE_ESC_DIGIT,
1407 CASE_ESC_DIGIT,
1408 CASE_ESC_DIGIT,
1409 /*	8		9		:		;	*/
1410 CASE_ESC_DIGIT,
1411 CASE_ESC_DIGIT,
1412 CASE_IGNORE,
1413 CASE_ESC_SEMI,
1414 /*	<		=		>		?	*/
1415 CASE_IGNORE,
1416 CASE_IGNORE,
1417 CASE_IGNORE,
1418 CASE_DEC_STATE,
1419 /*	@		A		B		C	*/
1420 CASE_ICH,
1421 CASE_CUU,
1422 CASE_CUD,
1423 CASE_CUF,
1424 /*	D		E		F		G	*/
1425 CASE_CUB,
1426 CASE_GROUND_STATE,
1427 CASE_GROUND_STATE,
1428 CASE_HPA,
1429 /*	H		I		J		K	*/
1430 CASE_CUP,
1431 CASE_GROUND_STATE,
1432 CASE_ED,
1433 CASE_EL,
1434 /*	L		M		N		O	*/
1435 CASE_IL,
1436 CASE_DL,
1437 CASE_GROUND_STATE,
1438 CASE_GROUND_STATE,
1439 /*	P		Q		R		S	*/
1440 CASE_DCH,
1441 CASE_GROUND_STATE,
1442 CASE_GROUND_STATE,
1443 CASE_SU,
1444 /*	T		U		V		W	*/
1445 CASE_SD,
1446 CASE_GROUND_STATE,
1447 CASE_GROUND_STATE,
1448 CASE_GROUND_STATE,
1449 /*	X		Y		Z		[	*/
1450 CASE_ECH,
1451 CASE_GROUND_STATE,
1452 CASE_GROUND_STATE,
1453 CASE_GROUND_STATE,
1454 /*	\		]		^		_	*/
1455 CASE_GROUND_STATE,
1456 CASE_GROUND_STATE,
1457 CASE_GROUND_STATE,
1458 CASE_GROUND_STATE,
1459 /*	`		a		b		c	*/
1460 CASE_GROUND_STATE,
1461 CASE_GROUND_STATE,
1462 CASE_GROUND_STATE,
1463 CASE_DA1,
1464 /*	d		e		f		g	*/
1465 CASE_VPA,
1466 CASE_GROUND_STATE,
1467 CASE_CUP,
1468 CASE_TBC,
1469 /*	h		i		j		k	*/
1470 CASE_SET,
1471 CASE_GROUND_STATE,
1472 CASE_GROUND_STATE,
1473 CASE_GROUND_STATE,
1474 /*	l		m		n		o	*/
1475 CASE_RST,
1476 CASE_SGR,
1477 CASE_CPR,
1478 CASE_GROUND_STATE,
1479 /*	p		q		r		s	*/
1480 CASE_GROUND_STATE,
1481 CASE_GROUND_STATE,
1482 CASE_DECSTBM,
1483 CASE_GROUND_STATE,
1484 /*	t		u		v		w	*/
1485 CASE_GROUND_STATE,
1486 CASE_GROUND_STATE,
1487 CASE_GROUND_STATE,
1488 CASE_GROUND_STATE,
1489 /*	x		y		z		{	*/
1490 CASE_DECREQTPARM,
1491 CASE_GROUND_STATE,
1492 CASE_GROUND_STATE,
1493 CASE_GROUND_STATE,
1494 /*	|		}		~		DEL	*/
1495 CASE_GROUND_STATE,
1496 CASE_GROUND_STATE,
1497 CASE_GROUND_STATE,
1498 CASE_GROUND_STATE,
1499 /*      0x80            0x81            0x82            0x83    */
1500 CASE_IGNORE,
1501 CASE_IGNORE,
1502 CASE_IGNORE,
1503 CASE_IGNORE,
1504 /*      0x84            0x85            0x86            0x87    */
1505 CASE_IGNORE,
1506 CASE_IGNORE,
1507 CASE_IGNORE,
1508 CASE_IGNORE,
1509 /*      0x88            0x89            0x8a            0x8b    */
1510 CASE_IGNORE,
1511 CASE_IGNORE,
1512 CASE_IGNORE,
1513 CASE_IGNORE,
1514 /*      0x8c            0x8d            0x8e            0x8f    */
1515 CASE_IGNORE,
1516 CASE_IGNORE,
1517 CASE_IGNORE,
1518 CASE_IGNORE,
1519 /*      0x90            0x91            0x92            0x93    */
1520 CASE_IGNORE,
1521 CASE_IGNORE,
1522 CASE_IGNORE,
1523 CASE_IGNORE,
1524 /*      0x94            0x95            0x96            0x97    */
1525 CASE_IGNORE,
1526 CASE_IGNORE,
1527 CASE_IGNORE,
1528 CASE_IGNORE,
1529 /*      0x99            0x99            0x9a            0x9b    */
1530 CASE_IGNORE,
1531 CASE_IGNORE,
1532 CASE_IGNORE,
1533 CASE_IGNORE,
1534 /*      0x9c            0x9d            0x9e            0x9f    */
1535 CASE_IGNORE,
1536 CASE_IGNORE,
1537 CASE_IGNORE,
1538 CASE_IGNORE,
1539 /*      nobreakspace    exclamdown      cent            sterling        */
1540 CASE_GROUND_STATE,
1541 CASE_GROUND_STATE,
1542 CASE_GROUND_STATE,
1543 CASE_GROUND_STATE,
1544 /*      currency        yen             brokenbar       section         */
1545 CASE_GROUND_STATE,
1546 CASE_GROUND_STATE,
1547 CASE_GROUND_STATE,
1548 CASE_GROUND_STATE,
1549 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
1550 CASE_GROUND_STATE,
1551 CASE_GROUND_STATE,
1552 CASE_GROUND_STATE,
1553 CASE_GROUND_STATE,
1554 /*      notsign         hyphen          registered      macron          */
1555 CASE_GROUND_STATE,
1556 CASE_GROUND_STATE,
1557 CASE_GROUND_STATE,
1558 CASE_GROUND_STATE,
1559 /*      degree          plusminus       twosuperior     threesuperior   */
1560 CASE_GROUND_STATE,
1561 CASE_GROUND_STATE,
1562 CASE_GROUND_STATE,
1563 CASE_GROUND_STATE,
1564 /*      acute           mu              paragraph       periodcentered  */
1565 CASE_GROUND_STATE,
1566 CASE_GROUND_STATE,
1567 CASE_GROUND_STATE,
1568 CASE_GROUND_STATE,
1569 /*      cedilla         onesuperior     masculine       guillemotright  */
1570 CASE_GROUND_STATE,
1571 CASE_GROUND_STATE,
1572 CASE_GROUND_STATE,
1573 CASE_GROUND_STATE,
1574 /*      onequarter      onehalf         threequarters   questiondown    */
1575 CASE_GROUND_STATE,
1576 CASE_GROUND_STATE,
1577 CASE_GROUND_STATE,
1578 CASE_GROUND_STATE,
1579 /*      Agrave          Aacute          Acircumflex     Atilde          */
1580 CASE_GROUND_STATE,
1581 CASE_GROUND_STATE,
1582 CASE_GROUND_STATE,
1583 CASE_GROUND_STATE,
1584 /*      Adiaeresis      Aring           AE              Ccedilla        */
1585 CASE_GROUND_STATE,
1586 CASE_GROUND_STATE,
1587 CASE_GROUND_STATE,
1588 CASE_GROUND_STATE,
1589 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
1590 CASE_GROUND_STATE,
1591 CASE_GROUND_STATE,
1592 CASE_GROUND_STATE,
1593 CASE_GROUND_STATE,
1594 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
1595 CASE_GROUND_STATE,
1596 CASE_GROUND_STATE,
1597 CASE_GROUND_STATE,
1598 CASE_GROUND_STATE,
1599 /*      Eth             Ntilde          Ograve          Oacute          */
1600 CASE_GROUND_STATE,
1601 CASE_GROUND_STATE,
1602 CASE_GROUND_STATE,
1603 CASE_GROUND_STATE,
1604 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
1605 CASE_GROUND_STATE,
1606 CASE_GROUND_STATE,
1607 CASE_GROUND_STATE,
1608 CASE_GROUND_STATE,
1609 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
1610 CASE_GROUND_STATE,
1611 CASE_GROUND_STATE,
1612 CASE_GROUND_STATE,
1613 CASE_GROUND_STATE,
1614 /*      Udiaeresis      Yacute          Thorn           ssharp          */
1615 CASE_GROUND_STATE,
1616 CASE_GROUND_STATE,
1617 CASE_GROUND_STATE,
1618 CASE_GROUND_STATE,
1619 /*      agrave          aacute          acircumflex     atilde          */
1620 CASE_GROUND_STATE,
1621 CASE_GROUND_STATE,
1622 CASE_GROUND_STATE,
1623 CASE_GROUND_STATE,
1624 /*      adiaeresis      aring           ae              ccedilla        */
1625 CASE_GROUND_STATE,
1626 CASE_GROUND_STATE,
1627 CASE_GROUND_STATE,
1628 CASE_GROUND_STATE,
1629 /*      egrave          eacute          ecircumflex     ediaeresis      */
1630 CASE_GROUND_STATE,
1631 CASE_GROUND_STATE,
1632 CASE_GROUND_STATE,
1633 CASE_GROUND_STATE,
1634 /*      igrave          iacute          icircumflex     idiaeresis      */
1635 CASE_GROUND_STATE,
1636 CASE_GROUND_STATE,
1637 CASE_GROUND_STATE,
1638 CASE_GROUND_STATE,
1639 /*      eth             ntilde          ograve          oacute          */
1640 CASE_GROUND_STATE,
1641 CASE_GROUND_STATE,
1642 CASE_GROUND_STATE,
1643 CASE_GROUND_STATE,
1644 /*      ocircumflex     otilde          odiaeresis      division        */
1645 CASE_GROUND_STATE,
1646 CASE_GROUND_STATE,
1647 CASE_GROUND_STATE,
1648 CASE_GROUND_STATE,
1649 /*      oslash          ugrave          uacute          ucircumflex     */
1650 CASE_GROUND_STATE,
1651 CASE_GROUND_STATE,
1652 CASE_GROUND_STATE,
1653 CASE_GROUND_STATE,
1654 /*      udiaeresis      yacute          thorn           ydiaeresis      */
1655 CASE_GROUND_STATE,
1656 CASE_GROUND_STATE,
1657 CASE_GROUND_STATE,
1658 CASE_GROUND_STATE,
1659 };
1660 
1661 // #pragma mark ESC [ ? - DEC table
1662 int gDecTable[] =
1663 {
1664 /*	NUL		SOH		STX		ETX	*/
1665 CASE_IGNORE,
1666 CASE_IGNORE,
1667 CASE_IGNORE,
1668 CASE_IGNORE,
1669 /*	EOT		ENQ		ACK		BEL	*/
1670 CASE_IGNORE,
1671 CASE_IGNORE,
1672 CASE_IGNORE,
1673 CASE_BELL,
1674 /*	BS		HT		NL		VT	*/
1675 CASE_BS,
1676 CASE_TAB,
1677 CASE_VMOT,
1678 CASE_VMOT,
1679 /*	NP		CR		SO		SI	*/
1680 CASE_VMOT,
1681 CASE_CR,
1682 CASE_SO,
1683 CASE_SI,
1684 /*	DLE		DC1		DC2		DC3	*/
1685 CASE_IGNORE,
1686 CASE_IGNORE,
1687 CASE_IGNORE,
1688 CASE_IGNORE,
1689 /*	DC4		NAK		SYN		ETB	*/
1690 CASE_IGNORE,
1691 CASE_IGNORE,
1692 CASE_IGNORE,
1693 CASE_IGNORE,
1694 /*	CAN		EM		SUB		ESC	*/
1695 CASE_IGNORE,
1696 CASE_IGNORE,
1697 CASE_IGNORE,
1698 CASE_ESC,
1699 /*	FS		GS		RS		US	*/
1700 CASE_IGNORE,
1701 CASE_IGNORE,
1702 CASE_IGNORE,
1703 CASE_IGNORE,
1704 /*	SP		!		"		#	*/
1705 CASE_ESC_IGNORE,
1706 CASE_ESC_IGNORE,
1707 CASE_ESC_IGNORE,
1708 CASE_ESC_IGNORE,
1709 /*	$		%		&		'	*/
1710 CASE_ESC_IGNORE,
1711 CASE_ESC_IGNORE,
1712 CASE_ESC_IGNORE,
1713 CASE_ESC_IGNORE,
1714 /*	(		)		*		+	*/
1715 CASE_ESC_IGNORE,
1716 CASE_ESC_IGNORE,
1717 CASE_ESC_IGNORE,
1718 CASE_ESC_IGNORE,
1719 /*	,		-		.		/	*/
1720 CASE_ESC_IGNORE,
1721 CASE_ESC_IGNORE,
1722 CASE_ESC_IGNORE,
1723 CASE_ESC_IGNORE,
1724 /*	0		1		2		3	*/
1725 CASE_ESC_DIGIT,
1726 CASE_ESC_DIGIT,
1727 CASE_ESC_DIGIT,
1728 CASE_ESC_DIGIT,
1729 /*	4		5		6		7	*/
1730 CASE_ESC_DIGIT,
1731 CASE_ESC_DIGIT,
1732 CASE_ESC_DIGIT,
1733 CASE_ESC_DIGIT,
1734 /*	8		9		:		;	*/
1735 CASE_ESC_DIGIT,
1736 CASE_ESC_DIGIT,
1737 CASE_IGNORE,
1738 CASE_ESC_SEMI,
1739 /*	<		=		>		?	*/
1740 CASE_GROUND_STATE,
1741 CASE_GROUND_STATE,
1742 CASE_GROUND_STATE,
1743 CASE_GROUND_STATE,
1744 /*	@		A		B		C	*/
1745 CASE_GROUND_STATE,
1746 CASE_GROUND_STATE,
1747 CASE_GROUND_STATE,
1748 CASE_GROUND_STATE,
1749 /*	D		E		F		G	*/
1750 CASE_GROUND_STATE,
1751 #ifdef STATUSLINE
1752 CASE_ERASE_STATUS,
1753 CASE_FROM_STATUS,
1754 #else /* !STATUSLINE */
1755 CASE_GROUND_STATE,
1756 CASE_GROUND_STATE,
1757 #endif /* !STATUSLINE */
1758 CASE_GROUND_STATE,
1759 /*	H		I		J		K	*/
1760 #ifdef STATUSLINE
1761 CASE_HIDE_STATUS,
1762 #else /* !STATUSLINE */
1763 CASE_GROUND_STATE,
1764 #endif /* !STATUSLINE */
1765 CASE_GROUND_STATE,
1766 CASE_GROUND_STATE,
1767 CASE_GROUND_STATE,
1768 /*	L		M		N		O	*/
1769 CASE_GROUND_STATE,
1770 CASE_GROUND_STATE,
1771 CASE_GROUND_STATE,
1772 CASE_GROUND_STATE,
1773 /*	P		Q		R		S	*/
1774 CASE_GROUND_STATE,
1775 CASE_GROUND_STATE,
1776 CASE_GROUND_STATE,
1777 #ifdef STATUSLINE
1778 CASE_SHOW_STATUS,
1779 #else /* !STATUSLINE */
1780 CASE_GROUND_STATE,
1781 #endif /* !STATUSLINE */
1782 /*	T		U		V		W	*/
1783 #ifdef STATUSLINE
1784 CASE_TO_STATUS,
1785 #else /* !STATUSLINE */
1786 CASE_GROUND_STATE,
1787 #endif /* !STATUSLINE */
1788 CASE_GROUND_STATE,
1789 CASE_GROUND_STATE,
1790 CASE_GROUND_STATE,
1791 /*	X		Y		Z		[	*/
1792 CASE_GROUND_STATE,
1793 CASE_GROUND_STATE,
1794 CASE_GROUND_STATE,
1795 CASE_GROUND_STATE,
1796 /*	\		]		^		_	*/
1797 CASE_GROUND_STATE,
1798 CASE_GROUND_STATE,
1799 CASE_GROUND_STATE,
1800 CASE_GROUND_STATE,
1801 /*	`		a		b		c	*/
1802 CASE_GROUND_STATE,
1803 CASE_GROUND_STATE,
1804 CASE_GROUND_STATE,
1805 CASE_GROUND_STATE,
1806 /*	d		e		f		g	*/
1807 CASE_GROUND_STATE,
1808 CASE_GROUND_STATE,
1809 CASE_GROUND_STATE,
1810 CASE_GROUND_STATE,
1811 /*	h		i		j		k	*/
1812 CASE_DECSET,
1813 CASE_GROUND_STATE,
1814 CASE_GROUND_STATE,
1815 CASE_GROUND_STATE,
1816 /*	l		m		n		o	*/
1817 CASE_DECRST,
1818 CASE_GROUND_STATE,
1819 CASE_GROUND_STATE,
1820 CASE_GROUND_STATE,
1821 /*	p		q		r		s	*/
1822 CASE_GROUND_STATE,
1823 CASE_GROUND_STATE,
1824 CASE_GROUND_STATE,
1825 CASE_GROUND_STATE,
1826 /*	t		u		v		w	*/
1827 CASE_GROUND_STATE,
1828 CASE_GROUND_STATE,
1829 CASE_GROUND_STATE,
1830 CASE_GROUND_STATE,
1831 /*	x		y		z		{	*/
1832 CASE_GROUND_STATE,
1833 CASE_GROUND_STATE,
1834 CASE_GROUND_STATE,
1835 CASE_GROUND_STATE,
1836 /*	|		}		~		DEL	*/
1837 CASE_GROUND_STATE,
1838 CASE_GROUND_STATE,
1839 CASE_GROUND_STATE,
1840 CASE_GROUND_STATE,
1841 /*      0x80            0x81            0x82            0x83    */
1842 CASE_IGNORE,
1843 CASE_IGNORE,
1844 CASE_IGNORE,
1845 CASE_IGNORE,
1846 /*      0x84            0x85            0x86            0x87    */
1847 CASE_IGNORE,
1848 CASE_IGNORE,
1849 CASE_IGNORE,
1850 CASE_IGNORE,
1851 /*      0x88            0x89            0x8a            0x8b    */
1852 CASE_IGNORE,
1853 CASE_IGNORE,
1854 CASE_IGNORE,
1855 CASE_IGNORE,
1856 /*      0x8c            0x8d            0x8e            0x8f    */
1857 CASE_IGNORE,
1858 CASE_IGNORE,
1859 CASE_IGNORE,
1860 CASE_IGNORE,
1861 /*      0x90            0x91            0x92            0x93    */
1862 CASE_IGNORE,
1863 CASE_IGNORE,
1864 CASE_IGNORE,
1865 CASE_IGNORE,
1866 /*      0x94            0x95            0x96            0x97    */
1867 CASE_IGNORE,
1868 CASE_IGNORE,
1869 CASE_IGNORE,
1870 CASE_IGNORE,
1871 /*      0x99            0x99            0x9a            0x9b    */
1872 CASE_IGNORE,
1873 CASE_IGNORE,
1874 CASE_IGNORE,
1875 CASE_IGNORE,
1876 /*      0x9c            0x9d            0x9e            0x9f    */
1877 CASE_IGNORE,
1878 CASE_IGNORE,
1879 CASE_IGNORE,
1880 CASE_IGNORE,
1881 /*      nobreakspace    exclamdown      cent            sterling        */
1882 CASE_GROUND_STATE,
1883 CASE_GROUND_STATE,
1884 CASE_GROUND_STATE,
1885 CASE_GROUND_STATE,
1886 /*      currency        yen             brokenbar       section         */
1887 CASE_GROUND_STATE,
1888 CASE_GROUND_STATE,
1889 CASE_GROUND_STATE,
1890 CASE_GROUND_STATE,
1891 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
1892 CASE_GROUND_STATE,
1893 CASE_GROUND_STATE,
1894 CASE_GROUND_STATE,
1895 CASE_GROUND_STATE,
1896 /*      notsign         hyphen          registered      macron          */
1897 CASE_GROUND_STATE,
1898 CASE_GROUND_STATE,
1899 CASE_GROUND_STATE,
1900 CASE_GROUND_STATE,
1901 /*      degree          plusminus       twosuperior     threesuperior   */
1902 CASE_GROUND_STATE,
1903 CASE_GROUND_STATE,
1904 CASE_GROUND_STATE,
1905 CASE_GROUND_STATE,
1906 /*      acute           mu              paragraph       periodcentered  */
1907 CASE_GROUND_STATE,
1908 CASE_GROUND_STATE,
1909 CASE_GROUND_STATE,
1910 CASE_GROUND_STATE,
1911 /*      cedilla         onesuperior     masculine       guillemotright  */
1912 CASE_GROUND_STATE,
1913 CASE_GROUND_STATE,
1914 CASE_GROUND_STATE,
1915 CASE_GROUND_STATE,
1916 /*      onequarter      onehalf         threequarters   questiondown    */
1917 CASE_GROUND_STATE,
1918 CASE_GROUND_STATE,
1919 CASE_GROUND_STATE,
1920 CASE_GROUND_STATE,
1921 /*      Agrave          Aacute          Acircumflex     Atilde          */
1922 CASE_GROUND_STATE,
1923 CASE_GROUND_STATE,
1924 CASE_GROUND_STATE,
1925 CASE_GROUND_STATE,
1926 /*      Adiaeresis      Aring           AE              Ccedilla        */
1927 CASE_GROUND_STATE,
1928 CASE_GROUND_STATE,
1929 CASE_GROUND_STATE,
1930 CASE_GROUND_STATE,
1931 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
1932 CASE_GROUND_STATE,
1933 CASE_GROUND_STATE,
1934 CASE_GROUND_STATE,
1935 CASE_GROUND_STATE,
1936 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
1937 CASE_GROUND_STATE,
1938 CASE_GROUND_STATE,
1939 CASE_GROUND_STATE,
1940 CASE_GROUND_STATE,
1941 /*      Eth             Ntilde          Ograve          Oacute          */
1942 CASE_GROUND_STATE,
1943 CASE_GROUND_STATE,
1944 CASE_GROUND_STATE,
1945 CASE_GROUND_STATE,
1946 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
1947 CASE_GROUND_STATE,
1948 CASE_GROUND_STATE,
1949 CASE_GROUND_STATE,
1950 CASE_GROUND_STATE,
1951 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
1952 CASE_GROUND_STATE,
1953 CASE_GROUND_STATE,
1954 CASE_GROUND_STATE,
1955 CASE_GROUND_STATE,
1956 /*      Udiaeresis      Yacute          Thorn           ssharp          */
1957 CASE_GROUND_STATE,
1958 CASE_GROUND_STATE,
1959 CASE_GROUND_STATE,
1960 CASE_GROUND_STATE,
1961 /*      agrave          aacute          acircumflex     atilde          */
1962 CASE_GROUND_STATE,
1963 CASE_GROUND_STATE,
1964 CASE_GROUND_STATE,
1965 CASE_GROUND_STATE,
1966 /*      adiaeresis      aring           ae              ccedilla        */
1967 CASE_GROUND_STATE,
1968 CASE_GROUND_STATE,
1969 CASE_GROUND_STATE,
1970 CASE_GROUND_STATE,
1971 /*      egrave          eacute          ecircumflex     ediaeresis      */
1972 CASE_GROUND_STATE,
1973 CASE_GROUND_STATE,
1974 CASE_GROUND_STATE,
1975 CASE_GROUND_STATE,
1976 /*      igrave          iacute          icircumflex     idiaeresis      */
1977 CASE_GROUND_STATE,
1978 CASE_GROUND_STATE,
1979 CASE_GROUND_STATE,
1980 CASE_GROUND_STATE,
1981 /*      eth             ntilde          ograve          oacute          */
1982 CASE_GROUND_STATE,
1983 CASE_GROUND_STATE,
1984 CASE_GROUND_STATE,
1985 CASE_GROUND_STATE,
1986 /*      ocircumflex     otilde          odiaeresis      division        */
1987 CASE_GROUND_STATE,
1988 CASE_GROUND_STATE,
1989 CASE_GROUND_STATE,
1990 CASE_GROUND_STATE,
1991 /*      oslash          ugrave          uacute          ucircumflex     */
1992 CASE_GROUND_STATE,
1993 CASE_GROUND_STATE,
1994 CASE_GROUND_STATE,
1995 CASE_GROUND_STATE,
1996 /*      udiaeresis      yacute          thorn           ydiaeresis      */
1997 CASE_GROUND_STATE,
1998 CASE_GROUND_STATE,
1999 CASE_GROUND_STATE,
2000 CASE_GROUND_STATE,
2001 };
2002 
2003 // #pragma mark CASE_ESC_IGNORE table
2004 int gEscIgnoreTable[] =
2005 {
2006 /*	NUL		SOH		STX		ETX	*/
2007 CASE_IGNORE,
2008 CASE_IGNORE,
2009 CASE_IGNORE,
2010 CASE_IGNORE,
2011 /*	EOT		ENQ		ACK		BEL	*/
2012 CASE_IGNORE,
2013 CASE_IGNORE,
2014 CASE_IGNORE,
2015 CASE_BELL,
2016 /*	BS		HT		NL		VT	*/
2017 CASE_BS,
2018 CASE_TAB,
2019 CASE_VMOT,
2020 CASE_VMOT,
2021 /*	NP		CR		SO		SI	*/
2022 CASE_VMOT,
2023 CASE_CR,
2024 CASE_SO,
2025 CASE_SI,
2026 /*	DLE		DC1		DC2		DC3	*/
2027 CASE_IGNORE,
2028 CASE_IGNORE,
2029 CASE_IGNORE,
2030 CASE_IGNORE,
2031 /*	DC4		NAK		SYN		ETB	*/
2032 CASE_IGNORE,
2033 CASE_IGNORE,
2034 CASE_IGNORE,
2035 CASE_IGNORE,
2036 /*	CAN		EM		SUB		ESC	*/
2037 CASE_IGNORE,
2038 CASE_IGNORE,
2039 CASE_IGNORE,
2040 CASE_ESC,
2041 /*	FS		GS		RS		US	*/
2042 CASE_IGNORE,
2043 CASE_IGNORE,
2044 CASE_IGNORE,
2045 CASE_IGNORE,
2046 /*	SP		!		"		#	*/
2047 CASE_IGNORE,
2048 CASE_IGNORE,
2049 CASE_IGNORE,
2050 CASE_IGNORE,
2051 /*	$		%		&		'	*/
2052 CASE_IGNORE,
2053 CASE_IGNORE,
2054 CASE_IGNORE,
2055 CASE_IGNORE,
2056 /*	(		)		*		+	*/
2057 CASE_IGNORE,
2058 CASE_IGNORE,
2059 CASE_IGNORE,
2060 CASE_IGNORE,
2061 /*	,
2062 	-		.		/	*/
2063 CASE_IGNORE,
2064 CASE_IGNORE,
2065 CASE_IGNORE,
2066 CASE_IGNORE,
2067 /*	0		1		2		3	*/
2068 CASE_GROUND_STATE,
2069 CASE_GROUND_STATE,
2070 CASE_GROUND_STATE,
2071 CASE_GROUND_STATE,
2072 /*	4		5		6		7	*/
2073 CASE_GROUND_STATE,
2074 CASE_GROUND_STATE,
2075 CASE_GROUND_STATE,
2076 CASE_GROUND_STATE,
2077 /*	8		9		:		;	*/
2078 CASE_GROUND_STATE,
2079 CASE_GROUND_STATE,
2080 CASE_GROUND_STATE,
2081 CASE_GROUND_STATE,
2082 /*	<		=		>		?	*/
2083 CASE_GROUND_STATE,
2084 CASE_GROUND_STATE,
2085 CASE_GROUND_STATE,
2086 CASE_GROUND_STATE,
2087 /*	@		A		B		C	*/
2088 CASE_GROUND_STATE,
2089 CASE_GROUND_STATE,
2090 CASE_GROUND_STATE,
2091 CASE_GROUND_STATE,
2092 /*	D		E		F		G	*/
2093 CASE_GROUND_STATE,
2094 CASE_GROUND_STATE,
2095 CASE_GROUND_STATE,
2096 CASE_GROUND_STATE,
2097 /*	H		I		J		K	*/
2098 CASE_GROUND_STATE,
2099 CASE_GROUND_STATE,
2100 CASE_GROUND_STATE,
2101 CASE_GROUND_STATE,
2102 /*	L		M		N		O	*/
2103 CASE_GROUND_STATE,
2104 CASE_GROUND_STATE,
2105 CASE_GROUND_STATE,
2106 CASE_GROUND_STATE,
2107 /*	P		Q		R		S	*/
2108 CASE_GROUND_STATE,
2109 CASE_GROUND_STATE,
2110 CASE_GROUND_STATE,
2111 CASE_GROUND_STATE,
2112 /*	T		U		V		W	*/
2113 CASE_GROUND_STATE,
2114 CASE_GROUND_STATE,
2115 CASE_GROUND_STATE,
2116 CASE_GROUND_STATE,
2117 /*	X		Y		Z		[	*/
2118 CASE_GROUND_STATE,
2119 CASE_GROUND_STATE,
2120 CASE_GROUND_STATE,
2121 CASE_GROUND_STATE,
2122 /*	\		]		^		_	*/
2123 CASE_GROUND_STATE,
2124 CASE_GROUND_STATE,
2125 CASE_GROUND_STATE,
2126 CASE_GROUND_STATE,
2127 /*	`		a		b		c	*/
2128 CASE_GROUND_STATE,
2129 CASE_GROUND_STATE,
2130 CASE_GROUND_STATE,
2131 CASE_GROUND_STATE,
2132 /*	d		e		f		g	*/
2133 CASE_GROUND_STATE,
2134 CASE_GROUND_STATE,
2135 CASE_GROUND_STATE,
2136 CASE_GROUND_STATE,
2137 /*	h		i		j		k	*/
2138 CASE_GROUND_STATE,
2139 CASE_GROUND_STATE,
2140 CASE_GROUND_STATE,
2141 CASE_GROUND_STATE,
2142 /*	l		m		n		o	*/
2143 CASE_GROUND_STATE,
2144 CASE_GROUND_STATE,
2145 CASE_GROUND_STATE,
2146 CASE_GROUND_STATE,
2147 /*	p		q		r		s	*/
2148 CASE_GROUND_STATE,
2149 CASE_GROUND_STATE,
2150 CASE_GROUND_STATE,
2151 CASE_GROUND_STATE,
2152 /*	t		u		v		w	*/
2153 CASE_GROUND_STATE,
2154 CASE_GROUND_STATE,
2155 CASE_GROUND_STATE,
2156 CASE_GROUND_STATE,
2157 /*	x		y		z		{	*/
2158 CASE_GROUND_STATE,
2159 CASE_GROUND_STATE,
2160 CASE_GROUND_STATE,
2161 CASE_GROUND_STATE,
2162 /*	|		}		~		DEL	*/
2163 CASE_GROUND_STATE,
2164 CASE_GROUND_STATE,
2165 CASE_GROUND_STATE,
2166 CASE_GROUND_STATE,
2167 /*      0x80            0x81            0x82            0x83    */
2168 CASE_IGNORE,
2169 CASE_IGNORE,
2170 CASE_IGNORE,
2171 CASE_IGNORE,
2172 /*      0x84            0x85            0x86            0x87    */
2173 CASE_IGNORE,
2174 CASE_IGNORE,
2175 CASE_IGNORE,
2176 CASE_IGNORE,
2177 /*      0x88            0x89            0x8a            0x8b    */
2178 CASE_IGNORE,
2179 CASE_IGNORE,
2180 CASE_IGNORE,
2181 CASE_IGNORE,
2182 /*      0x8c            0x8d            0x8e            0x8f    */
2183 CASE_IGNORE,
2184 CASE_IGNORE,
2185 CASE_IGNORE,
2186 CASE_IGNORE,
2187 /*      0x90            0x91            0x92            0x93    */
2188 CASE_IGNORE,
2189 CASE_IGNORE,
2190 CASE_IGNORE,
2191 CASE_IGNORE,
2192 /*      0x94            0x95            0x96            0x97    */
2193 CASE_IGNORE,
2194 CASE_IGNORE,
2195 CASE_IGNORE,
2196 CASE_IGNORE,
2197 /*      0x99            0x99            0x9a            0x9b    */
2198 CASE_IGNORE,
2199 CASE_IGNORE,
2200 CASE_IGNORE,
2201 CASE_IGNORE,
2202 /*      0x9c            0x9d            0x9e            0x9f    */
2203 CASE_IGNORE,
2204 CASE_IGNORE,
2205 CASE_IGNORE,
2206 CASE_IGNORE,
2207 /*      nobreakspace    exclamdown      cent            sterling        */
2208 CASE_GROUND_STATE,
2209 CASE_GROUND_STATE,
2210 CASE_GROUND_STATE,
2211 CASE_GROUND_STATE,
2212 /*      currency        yen             brokenbar       section         */
2213 CASE_GROUND_STATE,
2214 CASE_GROUND_STATE,
2215 CASE_GROUND_STATE,
2216 CASE_GROUND_STATE,
2217 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
2218 CASE_GROUND_STATE,
2219 CASE_GROUND_STATE,
2220 CASE_GROUND_STATE,
2221 CASE_GROUND_STATE,
2222 /*      notsign         hyphen          registered      macron          */
2223 CASE_GROUND_STATE,
2224 CASE_GROUND_STATE,
2225 CASE_GROUND_STATE,
2226 CASE_GROUND_STATE,
2227 /*      degree          plusminus       twosuperior     threesuperior   */
2228 CASE_GROUND_STATE,
2229 CASE_GROUND_STATE,
2230 CASE_GROUND_STATE,
2231 CASE_GROUND_STATE,
2232 /*      acute           mu              paragraph       periodcentered  */
2233 CASE_GROUND_STATE,
2234 CASE_GROUND_STATE,
2235 CASE_GROUND_STATE,
2236 CASE_GROUND_STATE,
2237 /*      cedilla         onesuperior     masculine       guillemotright  */
2238 CASE_GROUND_STATE,
2239 CASE_GROUND_STATE,
2240 CASE_GROUND_STATE,
2241 CASE_GROUND_STATE,
2242 /*      onequarter      onehalf         threequarters   questiondown    */
2243 CASE_GROUND_STATE,
2244 CASE_GROUND_STATE,
2245 CASE_GROUND_STATE,
2246 CASE_GROUND_STATE,
2247 /*      Agrave          Aacute          Acircumflex     Atilde          */
2248 CASE_GROUND_STATE,
2249 CASE_GROUND_STATE,
2250 CASE_GROUND_STATE,
2251 CASE_GROUND_STATE,
2252 /*      Adiaeresis      Aring           AE              Ccedilla        */
2253 CASE_GROUND_STATE,
2254 CASE_GROUND_STATE,
2255 CASE_GROUND_STATE,
2256 CASE_GROUND_STATE,
2257 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
2258 CASE_GROUND_STATE,
2259 CASE_GROUND_STATE,
2260 CASE_GROUND_STATE,
2261 CASE_GROUND_STATE,
2262 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
2263 CASE_GROUND_STATE,
2264 CASE_GROUND_STATE,
2265 CASE_GROUND_STATE,
2266 CASE_GROUND_STATE,
2267 /*      Eth             Ntilde          Ograve          Oacute          */
2268 CASE_GROUND_STATE,
2269 CASE_GROUND_STATE,
2270 CASE_GROUND_STATE,
2271 CASE_GROUND_STATE,
2272 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
2273 CASE_GROUND_STATE,
2274 CASE_GROUND_STATE,
2275 CASE_GROUND_STATE,
2276 CASE_GROUND_STATE,
2277 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
2278 CASE_GROUND_STATE,
2279 CASE_GROUND_STATE,
2280 CASE_GROUND_STATE,
2281 CASE_GROUND_STATE,
2282 /*      Udiaeresis      Yacute          Thorn           ssharp          */
2283 CASE_GROUND_STATE,
2284 CASE_GROUND_STATE,
2285 CASE_GROUND_STATE,
2286 CASE_GROUND_STATE,
2287 /*      agrave          aacute          acircumflex     atilde          */
2288 CASE_GROUND_STATE,
2289 CASE_GROUND_STATE,
2290 CASE_GROUND_STATE,
2291 CASE_GROUND_STATE,
2292 /*      adiaeresis      aring           ae              ccedilla        */
2293 CASE_GROUND_STATE,
2294 CASE_GROUND_STATE,
2295 CASE_GROUND_STATE,
2296 CASE_GROUND_STATE,
2297 /*      egrave          eacute          ecircumflex     ediaeresis      */
2298 CASE_GROUND_STATE,
2299 CASE_GROUND_STATE,
2300 CASE_GROUND_STATE,
2301 CASE_GROUND_STATE,
2302 /*      igrave          iacute          icircumflex     idiaeresis      */
2303 CASE_GROUND_STATE,
2304 CASE_GROUND_STATE,
2305 CASE_GROUND_STATE,
2306 CASE_GROUND_STATE,
2307 /*      eth             ntilde          ograve          oacute          */
2308 CASE_GROUND_STATE,
2309 CASE_GROUND_STATE,
2310 CASE_GROUND_STATE,
2311 CASE_GROUND_STATE,
2312 /*      ocircumflex     otilde          odiaeresis      division        */
2313 CASE_GROUND_STATE,
2314 CASE_GROUND_STATE,
2315 CASE_GROUND_STATE,
2316 CASE_GROUND_STATE,
2317 /*      oslash          ugrave          uacute          ucircumflex     */
2318 CASE_GROUND_STATE,
2319 CASE_GROUND_STATE,
2320 CASE_GROUND_STATE,
2321 CASE_GROUND_STATE,
2322 /*      udiaeresis      yacute          thorn           ydiaeresis      */
2323 CASE_GROUND_STATE,
2324 CASE_GROUND_STATE,
2325 CASE_GROUND_STATE,
2326 CASE_GROUND_STATE,
2327 };
2328 
2329 // #pragma mark ESC table
2330 int gEscTable[] =
2331 {
2332 /*	NUL		SOH		STX		ETX	*/
2333 CASE_IGNORE,
2334 CASE_IGNORE,
2335 CASE_IGNORE,
2336 CASE_IGNORE,
2337 /*	EOT		ENQ		ACK		BEL	*/
2338 CASE_IGNORE,
2339 CASE_IGNORE,
2340 CASE_IGNORE,
2341 CASE_BELL,
2342 /*	BS		HT		NL		VT	*/
2343 CASE_BS,
2344 CASE_TAB,
2345 CASE_LF,
2346 CASE_LF, /*CASE_UP,*/
2347 /*	NP		CR		SO		SI	*/
2348 CASE_LF, /*CASE_IGNORE,*/
2349 CASE_CR,
2350 CASE_SO,
2351 CASE_SI,
2352 /*	DLE		DC1		DC2		DC3	*/
2353 CASE_IGNORE,
2354 CASE_IGNORE,
2355 CASE_IGNORE,
2356 CASE_IGNORE,
2357 /*	DC4		NAK		SYN		ETB	*/
2358 CASE_IGNORE,
2359 CASE_IGNORE,
2360 CASE_IGNORE,
2361 CASE_IGNORE,
2362 /*	CAN		EM		SUB		ESC	*/
2363 CASE_IGNORE,
2364 CASE_IGNORE,
2365 CASE_IGNORE,
2366 CASE_ESC,
2367 /*	FS		GS		RS		US	*/
2368 CASE_IGNORE,
2369 CASE_IGNORE,
2370 CASE_IGNORE,
2371 CASE_IGNORE,
2372 /*	SP		!		"		#	*/
2373 CASE_ESC_IGNORE,
2374 CASE_ESC_IGNORE,
2375 CASE_ESC_IGNORE,
2376 CASE_SCR_STATE,
2377 /*	$		%		&		'	*/
2378 #ifdef USE_ISO2022
2379 CASE_MBCS,
2380 #else /* !USE_ISO2022 */
2381 CASE_ESC_IGNORE,
2382 #endif /* !USE_ISO2022 */
2383 CASE_ESC_IGNORE,
2384 CASE_ESC_IGNORE,
2385 CASE_ESC_IGNORE,
2386 /*	(		)		*		+	*/
2387 #ifdef USE_ISO2022
2388 CASE_SCS_STATE,
2389 CASE_SCS_STATE,
2390 CASE_SCS_STATE,
2391 CASE_SCS_STATE,
2392 #else /* !USE_ISO2022 */
2393 CASE_SCS0_STATE,
2394 CASE_SCS1_STATE,
2395 CASE_SCS2_STATE,
2396 CASE_SCS3_STATE,
2397 #endif /* !USE_ISO2022 */
2398 /*	,		-		.		/	*/
2399 #ifdef USE_ISO2022
2400 CASE_SCS_STATE,	/* not defined in ISO2022 but used in Mule */
2401 CASE_SCS_STATE,
2402 CASE_SCS_STATE,
2403 CASE_SCS_STATE,
2404 #else /* !USE_ISO2022 */
2405 CASE_ESC_IGNORE,
2406 CASE_ESC_IGNORE,
2407 CASE_ESC_IGNORE,
2408 CASE_ESC_IGNORE,
2409 #endif /* !USE_ISO2022 */
2410 /*	0		1		2		3	*/
2411 CASE_GROUND_STATE,
2412 CASE_GROUND_STATE,
2413 CASE_GROUND_STATE,
2414 CASE_GROUND_STATE,
2415 /*	4		5		6		7	*/
2416 CASE_GROUND_STATE,
2417 CASE_GROUND_STATE,
2418 CASE_GROUND_STATE,
2419 CASE_DECSC,
2420 /*	8		9		:		;	*/
2421 CASE_DECRC,
2422 CASE_GROUND_STATE,
2423 CASE_GROUND_STATE,
2424 CASE_GROUND_STATE,
2425 /*	<		=		>		?	*/
2426 CASE_GROUND_STATE,
2427 CASE_GROUND_STATE,
2428 CASE_GROUND_STATE,
2429 CASE_GROUND_STATE,
2430 /*	@		A		B		C	*/
2431 CASE_GROUND_STATE,
2432 CASE_GROUND_STATE,
2433 CASE_GROUND_STATE,
2434 CASE_GROUND_STATE,
2435 /*	D		E		F		G	*/
2436 CASE_GROUND_STATE,
2437 CASE_GROUND_STATE,
2438 CASE_GROUND_STATE,
2439 CASE_GROUND_STATE,
2440 /*	H		I		J		K	*/
2441 CASE_HTS,
2442 CASE_GROUND_STATE,
2443 CASE_GROUND_STATE,
2444 CASE_GROUND_STATE,
2445 /*	L		M		N		O	*/
2446 CASE_GROUND_STATE,
2447 CASE_RI,
2448 CASE_SS2,
2449 CASE_SS3,
2450 /*	P		Q		R		S	*/
2451 CASE_IGNORE_STATE,
2452 CASE_GROUND_STATE,
2453 CASE_GROUND_STATE,
2454 CASE_GROUND_STATE,
2455 /*	T		U		V		W	*/
2456 CASE_XTERM_TITLE,
2457 CASE_GROUND_STATE,
2458 CASE_GROUND_STATE,
2459 CASE_GROUND_STATE,
2460 /*	X		Y		Z		[	*/
2461 CASE_GROUND_STATE,
2462 CASE_GROUND_STATE,
2463 CASE_DA1,
2464 CASE_CSI_STATE,
2465 /*	\		]		^		_	*/
2466 CASE_GROUND_STATE,
2467 CASE_OSC,
2468 CASE_IGNORE_STATE,
2469 CASE_IGNORE_STATE,
2470 /*	`		a		b		c	*/
2471 CASE_GROUND_STATE,
2472 CASE_GROUND_STATE,
2473 CASE_GROUND_STATE,
2474 CASE_RIS,
2475 /*	d		e		f		g	*/
2476 CASE_GROUND_STATE,
2477 CASE_GROUND_STATE,
2478 CASE_GROUND_STATE,
2479 CASE_GROUND_STATE,
2480 /*	h		i		j		k	*/
2481 CASE_GROUND_STATE,
2482 CASE_GROUND_STATE,
2483 CASE_GROUND_STATE,
2484 CASE_GROUND_STATE,
2485 /*	l		m		n		o	*/
2486 CASE_GROUND_STATE,
2487 CASE_GROUND_STATE,
2488 CASE_LS2,
2489 CASE_LS3,
2490 /*	p		q		r		s	*/
2491 CASE_GROUND_STATE,
2492 CASE_GROUND_STATE,
2493 CASE_GROUND_STATE,
2494 CASE_GROUND_STATE,
2495 /*	t		u		v		w	*/
2496 CASE_GROUND_STATE,
2497 CASE_GROUND_STATE,
2498 CASE_GROUND_STATE,
2499 CASE_GROUND_STATE,
2500 /*	x		y		z		{	*/
2501 CASE_GROUND_STATE,
2502 CASE_GROUND_STATE,
2503 CASE_GROUND_STATE,
2504 CASE_GROUND_STATE,
2505 /*	|		}		~		DEL	*/
2506 CASE_LS3R,
2507 CASE_LS2R,
2508 CASE_LS1R,
2509 CASE_GROUND_STATE,
2510 /*      0x80            0x81            0x82            0x83    */
2511 CASE_IGNORE,
2512 CASE_IGNORE,
2513 CASE_IGNORE,
2514 CASE_IGNORE,
2515 /*      0x84            0x85            0x86            0x87    */
2516 CASE_IGNORE,
2517 CASE_IGNORE,
2518 CASE_IGNORE,
2519 CASE_IGNORE,
2520 /*      0x88            0x89            0x8a            0x8b    */
2521 CASE_IGNORE,
2522 CASE_IGNORE,
2523 CASE_IGNORE,
2524 CASE_IGNORE,
2525 /*      0x8c            0x8d            0x8e            0x8f    */
2526 CASE_IGNORE,
2527 CASE_IGNORE,
2528 CASE_IGNORE,
2529 CASE_IGNORE,
2530 /*      0x90            0x91            0x92            0x93    */
2531 CASE_IGNORE,
2532 CASE_IGNORE,
2533 CASE_IGNORE,
2534 CASE_IGNORE,
2535 /*      0x94            0x95            0x96            0x97    */
2536 CASE_IGNORE,
2537 CASE_IGNORE,
2538 CASE_IGNORE,
2539 CASE_IGNORE,
2540 /*      0x99            0x99            0x9a            0x9b    */
2541 CASE_IGNORE,
2542 CASE_IGNORE,
2543 CASE_IGNORE,
2544 CASE_IGNORE,
2545 /*      0x9c            0x9d            0x9e            0x9f    */
2546 CASE_IGNORE,
2547 CASE_IGNORE,
2548 CASE_IGNORE,
2549 CASE_IGNORE,
2550 /*      nobreakspace    exclamdown      cent            sterling        */
2551 CASE_GROUND_STATE,
2552 CASE_GROUND_STATE,
2553 CASE_GROUND_STATE,
2554 CASE_GROUND_STATE,
2555 /*      currency        yen             brokenbar       section         */
2556 CASE_GROUND_STATE,
2557 CASE_GROUND_STATE,
2558 CASE_GROUND_STATE,
2559 CASE_GROUND_STATE,
2560 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
2561 CASE_GROUND_STATE,
2562 CASE_GROUND_STATE,
2563 CASE_GROUND_STATE,
2564 CASE_GROUND_STATE,
2565 /*      notsign         hyphen          registered      macron          */
2566 CASE_GROUND_STATE,
2567 CASE_GROUND_STATE,
2568 CASE_GROUND_STATE,
2569 CASE_GROUND_STATE,
2570 /*      degree          plusminus       twosuperior     threesuperior   */
2571 CASE_GROUND_STATE,
2572 CASE_GROUND_STATE,
2573 CASE_GROUND_STATE,
2574 CASE_GROUND_STATE,
2575 /*      acute           mu              paragraph       periodcentered  */
2576 CASE_GROUND_STATE,
2577 CASE_GROUND_STATE,
2578 CASE_GROUND_STATE,
2579 CASE_GROUND_STATE,
2580 /*      cedilla         onesuperior     masculine       guillemotright  */
2581 CASE_GROUND_STATE,
2582 CASE_GROUND_STATE,
2583 CASE_GROUND_STATE,
2584 CASE_GROUND_STATE,
2585 /*      onequarter      onehalf         threequarters   questiondown    */
2586 CASE_GROUND_STATE,
2587 CASE_GROUND_STATE,
2588 CASE_GROUND_STATE,
2589 CASE_GROUND_STATE,
2590 /*      Agrave          Aacute          Acircumflex     Atilde          */
2591 CASE_GROUND_STATE,
2592 CASE_GROUND_STATE,
2593 CASE_GROUND_STATE,
2594 CASE_GROUND_STATE,
2595 /*      Adiaeresis      Aring           AE              Ccedilla        */
2596 CASE_GROUND_STATE,
2597 CASE_GROUND_STATE,
2598 CASE_GROUND_STATE,
2599 CASE_GROUND_STATE,
2600 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
2601 CASE_GROUND_STATE,
2602 CASE_GROUND_STATE,
2603 CASE_GROUND_STATE,
2604 CASE_GROUND_STATE,
2605 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
2606 CASE_GROUND_STATE,
2607 CASE_GROUND_STATE,
2608 CASE_GROUND_STATE,
2609 CASE_GROUND_STATE,
2610 /*      Eth             Ntilde          Ograve          Oacute          */
2611 CASE_GROUND_STATE,
2612 CASE_GROUND_STATE,
2613 CASE_GROUND_STATE,
2614 CASE_GROUND_STATE,
2615 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
2616 CASE_GROUND_STATE,
2617 CASE_GROUND_STATE,
2618 CASE_GROUND_STATE,
2619 CASE_GROUND_STATE,
2620 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
2621 CASE_GROUND_STATE,
2622 CASE_GROUND_STATE,
2623 CASE_GROUND_STATE,
2624 CASE_GROUND_STATE,
2625 /*      Udiaeresis      Yacute          Thorn           ssharp          */
2626 CASE_GROUND_STATE,
2627 CASE_GROUND_STATE,
2628 CASE_GROUND_STATE,
2629 CASE_GROUND_STATE,
2630 /*      agrave          aacute          acircumflex     atilde          */
2631 CASE_GROUND_STATE,
2632 CASE_GROUND_STATE,
2633 CASE_GROUND_STATE,
2634 CASE_GROUND_STATE,
2635 /*      adiaeresis      aring           ae              ccedilla        */
2636 CASE_GROUND_STATE,
2637 CASE_GROUND_STATE,
2638 CASE_GROUND_STATE,
2639 CASE_GROUND_STATE,
2640 /*      egrave          eacute          ecircumflex     ediaeresis      */
2641 CASE_GROUND_STATE,
2642 CASE_GROUND_STATE,
2643 CASE_GROUND_STATE,
2644 CASE_GROUND_STATE,
2645 /*      igrave          iacute          icircumflex     idiaeresis      */
2646 CASE_GROUND_STATE,
2647 CASE_GROUND_STATE,
2648 CASE_GROUND_STATE,
2649 CASE_GROUND_STATE,
2650 /*      eth             ntilde          ograve          oacute          */
2651 CASE_GROUND_STATE,
2652 CASE_GROUND_STATE,
2653 CASE_GROUND_STATE,
2654 CASE_GROUND_STATE,
2655 /*      ocircumflex     otilde          odiaeresis      division        */
2656 CASE_GROUND_STATE,
2657 CASE_GROUND_STATE,
2658 CASE_GROUND_STATE,
2659 CASE_GROUND_STATE,
2660 /*      oslash          ugrave          uacute          ucircumflex     */
2661 CASE_GROUND_STATE,
2662 CASE_GROUND_STATE,
2663 CASE_GROUND_STATE,
2664 CASE_GROUND_STATE,
2665 /*      udiaeresis      yacute          thorn           ydiaeresis      */
2666 CASE_GROUND_STATE,
2667 CASE_GROUND_STATE,
2668 CASE_GROUND_STATE,
2669 CASE_GROUND_STATE,
2670 };
2671 
2672 // #pragma mark CASE_IGNORE_ESC table
2673 int gIesTable[] =
2674 {
2675 /*	NUL		SOH		STX		ETX	*/
2676 CASE_IGNORE_STATE,
2677 CASE_IGNORE_STATE,
2678 CASE_IGNORE_STATE,
2679 CASE_IGNORE_STATE,
2680 /*	EOT		ENQ		ACK		BEL	*/
2681 CASE_IGNORE_STATE,
2682 CASE_IGNORE_STATE,
2683 CASE_IGNORE_STATE,
2684 CASE_IGNORE_STATE,
2685 /*	BS		HT		NL		VT	*/
2686 CASE_IGNORE_STATE,
2687 CASE_IGNORE_STATE,
2688 CASE_IGNORE_STATE,
2689 CASE_IGNORE_STATE,
2690 /*	NP		CR		SO		SI	*/
2691 CASE_IGNORE_STATE,
2692 CASE_IGNORE_STATE,
2693 CASE_IGNORE_STATE,
2694 CASE_IGNORE_STATE,
2695 /*	DLE		DC1		DC2		DC3	*/
2696 CASE_IGNORE_STATE,
2697 CASE_IGNORE_STATE,
2698 CASE_IGNORE_STATE,
2699 CASE_IGNORE_STATE,
2700 /*	DC4		NAK		SYN		ETB	*/
2701 CASE_IGNORE_STATE,
2702 CASE_IGNORE_STATE,
2703 CASE_IGNORE_STATE,
2704 CASE_IGNORE_STATE,
2705 /*	CAN		EM		SUB		ESC	*/
2706 CASE_IGNORE_STATE,
2707 CASE_IGNORE_STATE,
2708 CASE_IGNORE_STATE,
2709 CASE_IGNORE_STATE,
2710 /*	FS		GS		RS		US	*/
2711 CASE_IGNORE_STATE,
2712 CASE_IGNORE_STATE,
2713 CASE_IGNORE_STATE,
2714 CASE_IGNORE_STATE,
2715 /*	SP		!		"		#	*/
2716 CASE_IGNORE_STATE,
2717 CASE_IGNORE_STATE,
2718 CASE_IGNORE_STATE,
2719 CASE_IGNORE_STATE,
2720 /*	$		%		&		'	*/
2721 CASE_IGNORE_STATE,
2722 CASE_IGNORE_STATE,
2723 CASE_IGNORE_STATE,
2724 CASE_IGNORE_STATE,
2725 /*	(		)		*		+	*/
2726 CASE_IGNORE_STATE,
2727 CASE_IGNORE_STATE,
2728 CASE_IGNORE_STATE,
2729 CASE_IGNORE_STATE,
2730 /*	,		-		.		/	*/
2731 CASE_IGNORE_STATE,
2732 CASE_IGNORE_STATE,
2733 CASE_IGNORE_STATE,
2734 CASE_IGNORE_STATE,
2735 /*	0		1		2		3	*/
2736 CASE_IGNORE_STATE,
2737 CASE_IGNORE_STATE,
2738 CASE_IGNORE_STATE,
2739 CASE_IGNORE_STATE,
2740 /*	4		5		6		7	*/
2741 CASE_IGNORE_STATE,
2742 CASE_IGNORE_STATE,
2743 CASE_IGNORE_STATE,
2744 CASE_IGNORE_STATE,
2745 /*	8		9		:		;	*/
2746 CASE_IGNORE_STATE,
2747 CASE_IGNORE_STATE,
2748 CASE_IGNORE_STATE,
2749 CASE_IGNORE_STATE,
2750 /*	<		=		>		?	*/
2751 CASE_IGNORE_STATE,
2752 CASE_IGNORE_STATE,
2753 CASE_IGNORE_STATE,
2754 CASE_IGNORE_STATE,
2755 /*	@		A		B		C	*/
2756 CASE_IGNORE_STATE,
2757 CASE_IGNORE_STATE,
2758 CASE_IGNORE_STATE,
2759 CASE_IGNORE_STATE,
2760 /*	D		E		F		G	*/
2761 CASE_IGNORE_STATE,
2762 CASE_IGNORE_STATE,
2763 CASE_IGNORE_STATE,
2764 CASE_IGNORE_STATE,
2765 /*	H		I		J		K	*/
2766 CASE_IGNORE_STATE,
2767 CASE_IGNORE_STATE,
2768 CASE_IGNORE_STATE,
2769 CASE_IGNORE_STATE,
2770 /*	L		M		N		O	*/
2771 CASE_IGNORE_STATE,
2772 CASE_IGNORE_STATE,
2773 CASE_IGNORE_STATE,
2774 CASE_IGNORE_STATE,
2775 /*	P		Q		R		S	*/
2776 CASE_IGNORE_STATE,
2777 CASE_IGNORE_STATE,
2778 CASE_IGNORE_STATE,
2779 CASE_IGNORE_STATE,
2780 /*	T		U		V		W	*/
2781 CASE_IGNORE_STATE,
2782 CASE_IGNORE_STATE,
2783 CASE_IGNORE_STATE,
2784 CASE_IGNORE_STATE,
2785 /*	X		Y		Z		[	*/
2786 CASE_IGNORE_STATE,
2787 CASE_IGNORE_STATE,
2788 CASE_IGNORE_STATE,
2789 CASE_IGNORE_STATE,
2790 /*	\		]		^		_	*/
2791 CASE_GROUND_STATE,
2792 CASE_IGNORE_STATE,
2793 CASE_IGNORE_STATE,
2794 CASE_IGNORE_STATE,
2795 /*	`		a		b		c	*/
2796 CASE_IGNORE_STATE,
2797 CASE_IGNORE_STATE,
2798 CASE_IGNORE_STATE,
2799 CASE_IGNORE_STATE,
2800 /*	d		e		f		g	*/
2801 CASE_IGNORE_STATE,
2802 CASE_IGNORE_STATE,
2803 CASE_IGNORE_STATE,
2804 CASE_IGNORE_STATE,
2805 /*	h		i		j		k	*/
2806 CASE_IGNORE_STATE,
2807 CASE_IGNORE_STATE,
2808 CASE_IGNORE_STATE,
2809 CASE_IGNORE_STATE,
2810 /*	l		m		n		o	*/
2811 CASE_IGNORE_STATE,
2812 CASE_IGNORE_STATE,
2813 CASE_IGNORE_STATE,
2814 CASE_IGNORE_STATE,
2815 /*	p		q		r		s	*/
2816 CASE_IGNORE_STATE,
2817 CASE_IGNORE_STATE,
2818 CASE_IGNORE_STATE,
2819 CASE_IGNORE_STATE,
2820 /*	t		u		v		w	*/
2821 CASE_IGNORE_STATE,
2822 CASE_IGNORE_STATE,
2823 CASE_IGNORE_STATE,
2824 CASE_IGNORE_STATE,
2825 /*	x		y		z		{	*/
2826 CASE_IGNORE_STATE,
2827 CASE_IGNORE_STATE,
2828 CASE_IGNORE_STATE,
2829 CASE_IGNORE_STATE,
2830 /*	|		}		~		DEL	*/
2831 CASE_IGNORE_STATE,
2832 CASE_IGNORE_STATE,
2833 CASE_IGNORE_STATE,
2834 CASE_IGNORE_STATE,
2835 /*      0x80            0x81            0x82            0x83    */
2836 CASE_IGNORE,
2837 CASE_IGNORE,
2838 CASE_IGNORE,
2839 CASE_IGNORE,
2840 /*      0x84            0x85            0x86            0x87    */
2841 CASE_IGNORE,
2842 CASE_IGNORE,
2843 CASE_IGNORE,
2844 CASE_IGNORE,
2845 /*      0x88            0x89            0x8a            0x8b    */
2846 CASE_IGNORE,
2847 CASE_IGNORE,
2848 CASE_IGNORE,
2849 CASE_IGNORE,
2850 /*      0x8c            0x8d            0x8e            0x8f    */
2851 CASE_IGNORE,
2852 CASE_IGNORE,
2853 CASE_IGNORE,
2854 CASE_IGNORE,
2855 /*      0x90            0x91            0x92            0x93    */
2856 CASE_IGNORE,
2857 CASE_IGNORE,
2858 CASE_IGNORE,
2859 CASE_IGNORE,
2860 /*      0x94            0x95            0x96            0x97    */
2861 CASE_IGNORE,
2862 CASE_IGNORE,
2863 CASE_IGNORE,
2864 CASE_IGNORE,
2865 /*      0x99            0x99            0x9a            0x9b    */
2866 CASE_IGNORE,
2867 CASE_IGNORE,
2868 CASE_IGNORE,
2869 CASE_IGNORE,
2870 /*      0x9c            0x9d            0x9e            0x9f    */
2871 CASE_IGNORE,
2872 CASE_IGNORE,
2873 CASE_IGNORE,
2874 CASE_IGNORE,
2875 /*      nobreakspace    exclamdown      cent            sterling        */
2876 CASE_GROUND_STATE,
2877 CASE_GROUND_STATE,
2878 CASE_GROUND_STATE,
2879 CASE_GROUND_STATE,
2880 /*      currency        yen             brokenbar       section         */
2881 CASE_GROUND_STATE,
2882 CASE_GROUND_STATE,
2883 CASE_GROUND_STATE,
2884 CASE_GROUND_STATE,
2885 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
2886 CASE_GROUND_STATE,
2887 CASE_GROUND_STATE,
2888 CASE_GROUND_STATE,
2889 CASE_GROUND_STATE,
2890 /*      notsign         hyphen          registered      macron          */
2891 CASE_GROUND_STATE,
2892 CASE_GROUND_STATE,
2893 CASE_GROUND_STATE,
2894 CASE_GROUND_STATE,
2895 /*      degree          plusminus       twosuperior     threesuperior   */
2896 CASE_GROUND_STATE,
2897 CASE_GROUND_STATE,
2898 CASE_GROUND_STATE,
2899 CASE_GROUND_STATE,
2900 /*      acute           mu              paragraph       periodcentered  */
2901 CASE_GROUND_STATE,
2902 CASE_GROUND_STATE,
2903 CASE_GROUND_STATE,
2904 CASE_GROUND_STATE,
2905 /*      cedilla         onesuperior     masculine       guillemotright  */
2906 CASE_GROUND_STATE,
2907 CASE_GROUND_STATE,
2908 CASE_GROUND_STATE,
2909 CASE_GROUND_STATE,
2910 /*      onequarter      onehalf         threequarters   questiondown    */
2911 CASE_GROUND_STATE,
2912 CASE_GROUND_STATE,
2913 CASE_GROUND_STATE,
2914 CASE_GROUND_STATE,
2915 /*      Agrave          Aacute          Acircumflex     Atilde          */
2916 CASE_GROUND_STATE,
2917 CASE_GROUND_STATE,
2918 CASE_GROUND_STATE,
2919 CASE_GROUND_STATE,
2920 /*      Adiaeresis      Aring           AE              Ccedilla        */
2921 CASE_GROUND_STATE,
2922 CASE_GROUND_STATE,
2923 CASE_GROUND_STATE,
2924 CASE_GROUND_STATE,
2925 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
2926 CASE_GROUND_STATE,
2927 CASE_GROUND_STATE,
2928 CASE_GROUND_STATE,
2929 CASE_GROUND_STATE,
2930 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
2931 CASE_GROUND_STATE,
2932 CASE_GROUND_STATE,
2933 CASE_GROUND_STATE,
2934 CASE_GROUND_STATE,
2935 /*      Eth             Ntilde          Ograve          Oacute          */
2936 CASE_GROUND_STATE,
2937 CASE_GROUND_STATE,
2938 CASE_GROUND_STATE,
2939 CASE_GROUND_STATE,
2940 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
2941 CASE_GROUND_STATE,
2942 CASE_GROUND_STATE,
2943 CASE_GROUND_STATE,
2944 CASE_GROUND_STATE,
2945 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
2946 CASE_GROUND_STATE,
2947 CASE_GROUND_STATE,
2948 CASE_GROUND_STATE,
2949 CASE_GROUND_STATE,
2950 /*      Udiaeresis      Yacute          Thorn           ssharp          */
2951 CASE_GROUND_STATE,
2952 CASE_GROUND_STATE,
2953 CASE_GROUND_STATE,
2954 CASE_GROUND_STATE,
2955 /*      agrave          aacute          acircumflex     atilde          */
2956 CASE_GROUND_STATE,
2957 CASE_GROUND_STATE,
2958 CASE_GROUND_STATE,
2959 CASE_GROUND_STATE,
2960 /*      adiaeresis      aring           ae              ccedilla        */
2961 CASE_GROUND_STATE,
2962 CASE_GROUND_STATE,
2963 CASE_GROUND_STATE,
2964 CASE_GROUND_STATE,
2965 /*      egrave          eacute          ecircumflex     ediaeresis      */
2966 CASE_GROUND_STATE,
2967 CASE_GROUND_STATE,
2968 CASE_GROUND_STATE,
2969 CASE_GROUND_STATE,
2970 /*      igrave          iacute          icircumflex     idiaeresis      */
2971 CASE_GROUND_STATE,
2972 CASE_GROUND_STATE,
2973 CASE_GROUND_STATE,
2974 CASE_GROUND_STATE,
2975 /*      eth             ntilde          ograve          oacute          */
2976 CASE_GROUND_STATE,
2977 CASE_GROUND_STATE,
2978 CASE_GROUND_STATE,
2979 CASE_GROUND_STATE,
2980 /*      ocircumflex     otilde          odiaeresis      division        */
2981 CASE_GROUND_STATE,
2982 CASE_GROUND_STATE,
2983 CASE_GROUND_STATE,
2984 CASE_GROUND_STATE,
2985 /*      oslash          ugrave          uacute          ucircumflex     */
2986 CASE_GROUND_STATE,
2987 CASE_GROUND_STATE,
2988 CASE_GROUND_STATE,
2989 CASE_GROUND_STATE,
2990 /*      udiaeresis      yacute          thorn           ydiaeresis      */
2991 CASE_GROUND_STATE,
2992 CASE_GROUND_STATE,
2993 CASE_GROUND_STATE,
2994 CASE_GROUND_STATE,
2995 };
2996 
2997 // #pragma mark CASE_IGNORE_STATE table
2998 int gIgnoreTable[] =
2999 {
3000 /*	NUL		SOH		STX		ETX	*/
3001 CASE_IGNORE,
3002 CASE_IGNORE,
3003 CASE_IGNORE,
3004 CASE_IGNORE,
3005 /*	EOT		ENQ		ACK		BEL	*/
3006 CASE_IGNORE,
3007 CASE_IGNORE,
3008 CASE_IGNORE,
3009 CASE_IGNORE,
3010 /*	BS		HT		NL		VT	*/
3011 CASE_IGNORE,
3012 CASE_IGNORE,
3013 CASE_IGNORE,
3014 CASE_IGNORE,
3015 /*	NP		CR		SO		SI	*/
3016 CASE_IGNORE,
3017 CASE_IGNORE,
3018 CASE_IGNORE,
3019 CASE_IGNORE,
3020 /*	DLE		DC1		DC2		DC3	*/
3021 CASE_IGNORE,
3022 CASE_IGNORE,
3023 CASE_IGNORE,
3024 CASE_IGNORE,
3025 /*	DC4		NAK		SYN		ETB	*/
3026 CASE_IGNORE,
3027 CASE_IGNORE,
3028 CASE_IGNORE,
3029 CASE_IGNORE,
3030 /*	CAN		EM		SUB		ESC	*/
3031 CASE_GROUND_STATE,
3032 CASE_IGNORE,
3033 CASE_GROUND_STATE,
3034 CASE_IGNORE_ESC,
3035 /*	FS		GS		RS		US	*/
3036 CASE_IGNORE,
3037 CASE_IGNORE,
3038 CASE_IGNORE,
3039 CASE_IGNORE,
3040 /*	SP		!		"		#	*/
3041 CASE_IGNORE,
3042 CASE_IGNORE,
3043 CASE_IGNORE,
3044 CASE_IGNORE,
3045 /*	$		%		&		'	*/
3046 CASE_IGNORE,
3047 CASE_IGNORE,
3048 CASE_IGNORE,
3049 CASE_IGNORE,
3050 /*	(		)		*		+	*/
3051 CASE_IGNORE,
3052 CASE_IGNORE,
3053 CASE_IGNORE,
3054 CASE_IGNORE,
3055 /*	,		-		.		/	*/
3056 CASE_IGNORE,
3057 CASE_IGNORE,
3058 CASE_IGNORE,
3059 CASE_IGNORE,
3060 /*	0		1		2		3	*/
3061 CASE_IGNORE,
3062 CASE_IGNORE,
3063 CASE_IGNORE,
3064 CASE_IGNORE,
3065 /*	4		5		6		7	*/
3066 CASE_IGNORE,
3067 CASE_IGNORE,
3068 CASE_IGNORE,
3069 CASE_IGNORE,
3070 /*	8		9		:		;	*/
3071 CASE_IGNORE,
3072 CASE_IGNORE,
3073 CASE_IGNORE,
3074 CASE_IGNORE,
3075 /*	<		=		>		?	*/
3076 CASE_IGNORE,
3077 CASE_IGNORE,
3078 CASE_IGNORE,
3079 CASE_IGNORE,
3080 /*	@		A		B		C	*/
3081 CASE_IGNORE,
3082 CASE_IGNORE,
3083 CASE_IGNORE,
3084 CASE_IGNORE,
3085 /*	D		E		F		G	*/
3086 CASE_IGNORE,
3087 CASE_IGNORE,
3088 CASE_IGNORE,
3089 CASE_IGNORE,
3090 /*	H		I		J		K	*/
3091 CASE_IGNORE,
3092 CASE_IGNORE,
3093 CASE_IGNORE,
3094 CASE_IGNORE,
3095 /*	L		M		N		O	*/
3096 CASE_IGNORE,
3097 CASE_IGNORE,
3098 CASE_IGNORE,
3099 CASE_IGNORE,
3100 /*	P		Q		R		S	*/
3101 CASE_IGNORE,
3102 CASE_IGNORE,
3103 CASE_IGNORE,
3104 CASE_IGNORE,
3105 /*	T		U		V		W	*/
3106 CASE_IGNORE,
3107 CASE_IGNORE,
3108 CASE_IGNORE,
3109 CASE_IGNORE,
3110 /*	X		Y		Z		[	*/
3111 CASE_IGNORE,
3112 CASE_IGNORE,
3113 CASE_IGNORE,
3114 CASE_IGNORE,
3115 /*	\		]		^		_	*/
3116 CASE_IGNORE,
3117 CASE_IGNORE,
3118 CASE_IGNORE,
3119 CASE_IGNORE,
3120 /*	`		a		b		c	*/
3121 CASE_IGNORE,
3122 CASE_IGNORE,
3123 CASE_IGNORE,
3124 CASE_IGNORE,
3125 /*	d		e		f		g	*/
3126 CASE_IGNORE,
3127 CASE_IGNORE,
3128 CASE_IGNORE,
3129 CASE_IGNORE,
3130 /*	h		i		j		k	*/
3131 CASE_IGNORE,
3132 CASE_IGNORE,
3133 CASE_IGNORE,
3134 CASE_IGNORE,
3135 /*	l		m		n		o	*/
3136 CASE_IGNORE,
3137 CASE_IGNORE,
3138 CASE_IGNORE,
3139 CASE_IGNORE,
3140 /*	p		q		r		s	*/
3141 CASE_IGNORE,
3142 CASE_IGNORE,
3143 CASE_IGNORE,
3144 CASE_IGNORE,
3145 /*	t		u		v		w	*/
3146 CASE_IGNORE,
3147 CASE_IGNORE,
3148 CASE_IGNORE,
3149 CASE_IGNORE,
3150 /*	x		y		z		{	*/
3151 CASE_IGNORE,
3152 CASE_IGNORE,
3153 CASE_IGNORE,
3154 CASE_IGNORE,
3155 /*	|		}		~		DEL	*/
3156 CASE_IGNORE,
3157 CASE_IGNORE,
3158 CASE_IGNORE,
3159 CASE_IGNORE,
3160 /*      0x80            0x81            0x82            0x83    */
3161 CASE_IGNORE,
3162 CASE_IGNORE,
3163 CASE_IGNORE,
3164 CASE_IGNORE,
3165 /*      0x84            0x85            0x86            0x87    */
3166 CASE_IGNORE,
3167 CASE_IGNORE,
3168 CASE_IGNORE,
3169 CASE_IGNORE,
3170 /*      0x88            0x89            0x8a            0x8b    */
3171 CASE_IGNORE,
3172 CASE_IGNORE,
3173 CASE_IGNORE,
3174 CASE_IGNORE,
3175 /*      0x8c            0x8d            0x8e            0x8f    */
3176 CASE_IGNORE,
3177 CASE_IGNORE,
3178 CASE_IGNORE,
3179 CASE_IGNORE,
3180 /*      0x90            0x91            0x92            0x93    */
3181 CASE_IGNORE,
3182 CASE_IGNORE,
3183 CASE_IGNORE,
3184 CASE_IGNORE,
3185 /*      0x94            0x95            0x96            0x97    */
3186 CASE_IGNORE,
3187 CASE_IGNORE,
3188 CASE_IGNORE,
3189 CASE_IGNORE,
3190 /*      0x99            0x99            0x9a            0x9b    */
3191 CASE_IGNORE,
3192 CASE_IGNORE,
3193 CASE_IGNORE,
3194 CASE_IGNORE,
3195 /*      0x9c            0x9d            0x9e            0x9f    */
3196 CASE_IGNORE,
3197 CASE_IGNORE,
3198 CASE_IGNORE,
3199 CASE_IGNORE,
3200 /*      nobreakspace    exclamdown      cent            sterling        */
3201 CASE_GROUND_STATE,
3202 CASE_GROUND_STATE,
3203 CASE_GROUND_STATE,
3204 CASE_GROUND_STATE,
3205 /*      currency        yen             brokenbar       section         */
3206 CASE_GROUND_STATE,
3207 CASE_GROUND_STATE,
3208 CASE_GROUND_STATE,
3209 CASE_GROUND_STATE,
3210 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
3211 CASE_GROUND_STATE,
3212 CASE_GROUND_STATE,
3213 CASE_GROUND_STATE,
3214 CASE_GROUND_STATE,
3215 /*      notsign         hyphen          registered      macron          */
3216 CASE_GROUND_STATE,
3217 CASE_GROUND_STATE,
3218 CASE_GROUND_STATE,
3219 CASE_GROUND_STATE,
3220 /*      degree          plusminus       twosuperior     threesuperior   */
3221 CASE_GROUND_STATE,
3222 CASE_GROUND_STATE,
3223 CASE_GROUND_STATE,
3224 CASE_GROUND_STATE,
3225 /*      acute           mu              paragraph       periodcentered  */
3226 CASE_GROUND_STATE,
3227 CASE_GROUND_STATE,
3228 CASE_GROUND_STATE,
3229 CASE_GROUND_STATE,
3230 /*      cedilla         onesuperior     masculine       guillemotright  */
3231 CASE_GROUND_STATE,
3232 CASE_GROUND_STATE,
3233 CASE_GROUND_STATE,
3234 CASE_GROUND_STATE,
3235 /*      onequarter      onehalf         threequarters   questiondown    */
3236 CASE_GROUND_STATE,
3237 CASE_GROUND_STATE,
3238 CASE_GROUND_STATE,
3239 CASE_GROUND_STATE,
3240 /*      Agrave          Aacute          Acircumflex     Atilde          */
3241 CASE_GROUND_STATE,
3242 CASE_GROUND_STATE,
3243 CASE_GROUND_STATE,
3244 CASE_GROUND_STATE,
3245 /*      Adiaeresis      Aring           AE              Ccedilla        */
3246 CASE_GROUND_STATE,
3247 CASE_GROUND_STATE,
3248 CASE_GROUND_STATE,
3249 CASE_GROUND_STATE,
3250 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
3251 CASE_GROUND_STATE,
3252 CASE_GROUND_STATE,
3253 CASE_GROUND_STATE,
3254 CASE_GROUND_STATE,
3255 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
3256 CASE_GROUND_STATE,
3257 CASE_GROUND_STATE,
3258 CASE_GROUND_STATE,
3259 CASE_GROUND_STATE,
3260 /*      Eth             Ntilde          Ograve          Oacute          */
3261 CASE_GROUND_STATE,
3262 CASE_GROUND_STATE,
3263 CASE_GROUND_STATE,
3264 CASE_GROUND_STATE,
3265 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
3266 CASE_GROUND_STATE,
3267 CASE_GROUND_STATE,
3268 CASE_GROUND_STATE,
3269 CASE_GROUND_STATE,
3270 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
3271 CASE_GROUND_STATE,
3272 CASE_GROUND_STATE,
3273 CASE_GROUND_STATE,
3274 CASE_GROUND_STATE,
3275 /*      Udiaeresis      Yacute          Thorn           ssharp          */
3276 CASE_GROUND_STATE,
3277 CASE_GROUND_STATE,
3278 CASE_GROUND_STATE,
3279 CASE_GROUND_STATE,
3280 /*      agrave          aacute          acircumflex     atilde          */
3281 CASE_GROUND_STATE,
3282 CASE_GROUND_STATE,
3283 CASE_GROUND_STATE,
3284 CASE_GROUND_STATE,
3285 /*      adiaeresis      aring           ae              ccedilla        */
3286 CASE_GROUND_STATE,
3287 CASE_GROUND_STATE,
3288 CASE_GROUND_STATE,
3289 CASE_GROUND_STATE,
3290 /*      egrave          eacute          ecircumflex     ediaeresis      */
3291 CASE_GROUND_STATE,
3292 CASE_GROUND_STATE,
3293 CASE_GROUND_STATE,
3294 CASE_GROUND_STATE,
3295 /*      igrave          iacute          icircumflex     idiaeresis      */
3296 CASE_GROUND_STATE,
3297 CASE_GROUND_STATE,
3298 CASE_GROUND_STATE,
3299 CASE_GROUND_STATE,
3300 /*      eth             ntilde          ograve          oacute          */
3301 CASE_GROUND_STATE,
3302 CASE_GROUND_STATE,
3303 CASE_GROUND_STATE,
3304 CASE_GROUND_STATE,
3305 /*      ocircumflex     otilde          odiaeresis      division        */
3306 CASE_GROUND_STATE,
3307 CASE_GROUND_STATE,
3308 CASE_GROUND_STATE,
3309 CASE_GROUND_STATE,
3310 /*      oslash          ugrave          uacute          ucircumflex     */
3311 CASE_GROUND_STATE,
3312 CASE_GROUND_STATE,
3313 CASE_GROUND_STATE,
3314 CASE_GROUND_STATE,
3315 /*      udiaeresis      yacute          thorn           ydiaeresis      */
3316 CASE_GROUND_STATE,
3317 CASE_GROUND_STATE,
3318 CASE_GROUND_STATE,
3319 CASE_GROUND_STATE,
3320 };
3321 
3322 // #pragma mark ESC # - SCR table
3323 int gScrTable[] =
3324 {
3325 /*	NUL		SOH		STX		ETX	*/
3326 CASE_IGNORE,
3327 CASE_IGNORE,
3328 CASE_IGNORE,
3329 CASE_IGNORE,
3330 /*	EOT		ENQ		ACK		BEL	*/
3331 CASE_IGNORE,
3332 CASE_IGNORE,
3333 CASE_IGNORE,
3334 CASE_BELL,
3335 /*	BS		HT		NL		VT	*/
3336 CASE_BS,
3337 CASE_TAB,
3338 CASE_VMOT,
3339 CASE_VMOT,
3340 /*	NP		CR		SO		SI	*/
3341 CASE_VMOT,
3342 CASE_CR,
3343 CASE_SO,
3344 CASE_SI,
3345 /*	DLE		DC1		DC2		DC3	*/
3346 CASE_IGNORE,
3347 CASE_IGNORE,
3348 CASE_IGNORE,
3349 CASE_IGNORE,
3350 /*	DC4		NAK		SYN		ETB	*/
3351 CASE_IGNORE,
3352 CASE_IGNORE,
3353 CASE_IGNORE,
3354 CASE_IGNORE,
3355 /*	CAN		EM		SUB		ESC	*/
3356 CASE_IGNORE,
3357 CASE_IGNORE,
3358 CASE_IGNORE,
3359 CASE_ESC,
3360 /*	FS		GS		RS		US	*/
3361 CASE_IGNORE,
3362 CASE_IGNORE,
3363 CASE_IGNORE,
3364 CASE_IGNORE,
3365 /*	SP		!		"		#	*/
3366 CASE_ESC_IGNORE,
3367 CASE_ESC_IGNORE,
3368 CASE_ESC_IGNORE,
3369 CASE_ESC_IGNORE,
3370 /*	$		%		&		'	*/
3371 CASE_ESC_IGNORE,
3372 CASE_ESC_IGNORE,
3373 CASE_ESC_IGNORE,
3374 CASE_ESC_IGNORE,
3375 /*	(		)		*		+	*/
3376 CASE_ESC_IGNORE,
3377 CASE_ESC_IGNORE,
3378 CASE_ESC_IGNORE,
3379 CASE_ESC_IGNORE,
3380 /*	,		-		.		/	*/
3381 CASE_ESC_IGNORE,
3382 CASE_ESC_IGNORE,
3383 CASE_ESC_IGNORE,
3384 CASE_ESC_IGNORE,
3385 /*	0		1		2		3	*/
3386 CASE_GROUND_STATE,
3387 CASE_GROUND_STATE,
3388 CASE_GROUND_STATE,
3389 CASE_GROUND_STATE,
3390 /*	4		5		6		7	*/
3391 CASE_GROUND_STATE,
3392 CASE_GROUND_STATE,
3393 CASE_GROUND_STATE,
3394 CASE_GROUND_STATE,
3395 /*	8		9		:		;	*/
3396 CASE_DECALN,
3397 CASE_GROUND_STATE,
3398 CASE_GROUND_STATE,
3399 CASE_GROUND_STATE,
3400 /*	<		=		>		?	*/
3401 CASE_GROUND_STATE,
3402 CASE_GROUND_STATE,
3403 CASE_GROUND_STATE,
3404 CASE_GROUND_STATE,
3405 /*	@		A		B		C	*/
3406 CASE_GROUND_STATE,
3407 CASE_GROUND_STATE,
3408 CASE_GROUND_STATE,
3409 CASE_GROUND_STATE,
3410 /*	D		E		F		G	*/
3411 CASE_GROUND_STATE,
3412 CASE_GROUND_STATE,
3413 CASE_GROUND_STATE,
3414 CASE_GROUND_STATE,
3415 /*	H		I		J		K	*/
3416 CASE_GROUND_STATE,
3417 CASE_GROUND_STATE,
3418 CASE_GROUND_STATE,
3419 CASE_GROUND_STATE,
3420 /*	L		M		N		O	*/
3421 CASE_GROUND_STATE,
3422 CASE_GROUND_STATE,
3423 CASE_GROUND_STATE,
3424 CASE_GROUND_STATE,
3425 /*	P		Q		R		S	*/
3426 CASE_GROUND_STATE,
3427 CASE_GROUND_STATE,
3428 CASE_GROUND_STATE,
3429 CASE_GROUND_STATE,
3430 /*	T		U		V		W	*/
3431 CASE_GROUND_STATE,
3432 CASE_GROUND_STATE,
3433 CASE_GROUND_STATE,
3434 CASE_GROUND_STATE,
3435 /*	X		Y		Z		[	*/
3436 CASE_GROUND_STATE,
3437 CASE_GROUND_STATE,
3438 CASE_GROUND_STATE,
3439 CASE_GROUND_STATE,
3440 /*	\		]		^		_	*/
3441 CASE_GROUND_STATE,
3442 CASE_GROUND_STATE,
3443 CASE_GROUND_STATE,
3444 CASE_GROUND_STATE,
3445 /*	`		a		b		c	*/
3446 CASE_GROUND_STATE,
3447 CASE_GROUND_STATE,
3448 CASE_GROUND_STATE,
3449 CASE_GROUND_STATE,
3450 /*	d		e		f		g	*/
3451 CASE_GROUND_STATE,
3452 CASE_GROUND_STATE,
3453 CASE_GROUND_STATE,
3454 CASE_GROUND_STATE,
3455 /*	h		i		j		k	*/
3456 CASE_GROUND_STATE,
3457 CASE_GROUND_STATE,
3458 CASE_GROUND_STATE,
3459 CASE_GROUND_STATE,
3460 /*	l		m		n		o	*/
3461 CASE_GROUND_STATE,
3462 CASE_GROUND_STATE,
3463 CASE_GROUND_STATE,
3464 CASE_GROUND_STATE,
3465 /*	p		q		r		s	*/
3466 CASE_GROUND_STATE,
3467 CASE_GROUND_STATE,
3468 CASE_GROUND_STATE,
3469 CASE_GROUND_STATE,
3470 /*	t		u		v		w	*/
3471 CASE_GROUND_STATE,
3472 CASE_GROUND_STATE,
3473 CASE_GROUND_STATE,
3474 CASE_GROUND_STATE,
3475 /*	x		y		z		{	*/
3476 CASE_GROUND_STATE,
3477 CASE_GROUND_STATE,
3478 CASE_GROUND_STATE,
3479 CASE_GROUND_STATE,
3480 /*	|		}		~		DEL	*/
3481 CASE_GROUND_STATE,
3482 CASE_GROUND_STATE,
3483 CASE_GROUND_STATE,
3484 CASE_GROUND_STATE,
3485 /*      0x80            0x81            0x82            0x83    */
3486 CASE_IGNORE,
3487 CASE_IGNORE,
3488 CASE_IGNORE,
3489 CASE_IGNORE,
3490 /*      0x84            0x85            0x86            0x87    */
3491 CASE_IGNORE,
3492 CASE_IGNORE,
3493 CASE_IGNORE,
3494 CASE_IGNORE,
3495 /*      0x88            0x89            0x8a            0x8b    */
3496 CASE_IGNORE,
3497 CASE_IGNORE,
3498 CASE_IGNORE,
3499 CASE_IGNORE,
3500 /*      0x8c            0x8d            0x8e            0x8f    */
3501 CASE_IGNORE,
3502 CASE_IGNORE,
3503 CASE_IGNORE,
3504 CASE_IGNORE,
3505 /*      0x90            0x91            0x92            0x93    */
3506 CASE_IGNORE,
3507 CASE_IGNORE,
3508 CASE_IGNORE,
3509 CASE_IGNORE,
3510 /*      0x94            0x95            0x96            0x97    */
3511 CASE_IGNORE,
3512 CASE_IGNORE,
3513 CASE_IGNORE,
3514 CASE_IGNORE,
3515 /*      0x99            0x99            0x9a            0x9b    */
3516 CASE_IGNORE,
3517 CASE_IGNORE,
3518 CASE_IGNORE,
3519 CASE_IGNORE,
3520 /*      0x9c            0x9d            0x9e            0x9f    */
3521 CASE_IGNORE,
3522 CASE_IGNORE,
3523 CASE_IGNORE,
3524 CASE_IGNORE,
3525 /*      nobreakspace    exclamdown      cent            sterling        */
3526 CASE_GROUND_STATE,
3527 CASE_GROUND_STATE,
3528 CASE_GROUND_STATE,
3529 CASE_GROUND_STATE,
3530 /*      currency        yen             brokenbar       section         */
3531 CASE_GROUND_STATE,
3532 CASE_GROUND_STATE,
3533 CASE_GROUND_STATE,
3534 CASE_GROUND_STATE,
3535 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
3536 CASE_GROUND_STATE,
3537 CASE_GROUND_STATE,
3538 CASE_GROUND_STATE,
3539 CASE_GROUND_STATE,
3540 /*      notsign         hyphen          registered      macron          */
3541 CASE_GROUND_STATE,
3542 CASE_GROUND_STATE,
3543 CASE_GROUND_STATE,
3544 CASE_GROUND_STATE,
3545 /*      degree          plusminus       twosuperior     threesuperior   */
3546 CASE_GROUND_STATE,
3547 CASE_GROUND_STATE,
3548 CASE_GROUND_STATE,
3549 CASE_GROUND_STATE,
3550 /*      acute           mu              paragraph       periodcentered  */
3551 CASE_GROUND_STATE,
3552 CASE_GROUND_STATE,
3553 CASE_GROUND_STATE,
3554 CASE_GROUND_STATE,
3555 /*      cedilla         onesuperior     masculine       guillemotright  */
3556 CASE_GROUND_STATE,
3557 CASE_GROUND_STATE,
3558 CASE_GROUND_STATE,
3559 CASE_GROUND_STATE,
3560 /*      onequarter      onehalf         threequarters   questiondown    */
3561 CASE_GROUND_STATE,
3562 CASE_GROUND_STATE,
3563 CASE_GROUND_STATE,
3564 CASE_GROUND_STATE,
3565 /*      Agrave          Aacute          Acircumflex     Atilde          */
3566 CASE_GROUND_STATE,
3567 CASE_GROUND_STATE,
3568 CASE_GROUND_STATE,
3569 CASE_GROUND_STATE,
3570 /*      Adiaeresis      Aring           AE              Ccedilla        */
3571 CASE_GROUND_STATE,
3572 CASE_GROUND_STATE,
3573 CASE_GROUND_STATE,
3574 CASE_GROUND_STATE,
3575 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
3576 CASE_GROUND_STATE,
3577 CASE_GROUND_STATE,
3578 CASE_GROUND_STATE,
3579 CASE_GROUND_STATE,
3580 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
3581 CASE_GROUND_STATE,
3582 CASE_GROUND_STATE,
3583 CASE_GROUND_STATE,
3584 CASE_GROUND_STATE,
3585 /*      Eth             Ntilde          Ograve          Oacute          */
3586 CASE_GROUND_STATE,
3587 CASE_GROUND_STATE,
3588 CASE_GROUND_STATE,
3589 CASE_GROUND_STATE,
3590 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
3591 CASE_GROUND_STATE,
3592 CASE_GROUND_STATE,
3593 CASE_GROUND_STATE,
3594 CASE_GROUND_STATE,
3595 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
3596 CASE_GROUND_STATE,
3597 CASE_GROUND_STATE,
3598 CASE_GROUND_STATE,
3599 CASE_GROUND_STATE,
3600 /*      Udiaeresis      Yacute          Thorn           ssharp          */
3601 CASE_GROUND_STATE,
3602 CASE_GROUND_STATE,
3603 CASE_GROUND_STATE,
3604 CASE_GROUND_STATE,
3605 /*      agrave          aacute          acircumflex     atilde          */
3606 CASE_GROUND_STATE,
3607 CASE_GROUND_STATE,
3608 CASE_GROUND_STATE,
3609 CASE_GROUND_STATE,
3610 /*      adiaeresis      aring           ae              ccedilla        */
3611 CASE_GROUND_STATE,
3612 CASE_GROUND_STATE,
3613 CASE_GROUND_STATE,
3614 CASE_GROUND_STATE,
3615 /*      egrave          eacute          ecircumflex     ediaeresis      */
3616 CASE_GROUND_STATE,
3617 CASE_GROUND_STATE,
3618 CASE_GROUND_STATE,
3619 CASE_GROUND_STATE,
3620 /*      igrave          iacute          icircumflex     idiaeresis      */
3621 CASE_GROUND_STATE,
3622 CASE_GROUND_STATE,
3623 CASE_GROUND_STATE,
3624 CASE_GROUND_STATE,
3625 /*      eth             ntilde          ograve          oacute          */
3626 CASE_GROUND_STATE,
3627 CASE_GROUND_STATE,
3628 CASE_GROUND_STATE,
3629 CASE_GROUND_STATE,
3630 /*      ocircumflex     otilde          odiaeresis      division        */
3631 CASE_GROUND_STATE,
3632 CASE_GROUND_STATE,
3633 CASE_GROUND_STATE,
3634 CASE_GROUND_STATE,
3635 /*      oslash          ugrave          uacute          ucircumflex     */
3636 CASE_GROUND_STATE,
3637 CASE_GROUND_STATE,
3638 CASE_GROUND_STATE,
3639 CASE_GROUND_STATE,
3640 /*      udiaeresis      yacute          thorn           ydiaeresis      */
3641 CASE_GROUND_STATE,
3642 CASE_GROUND_STATE,
3643 CASE_GROUND_STATE,
3644 CASE_GROUND_STATE,
3645 };
3646 
3647 // #pragma mark ESC ( - SCS table
3648 int gScsTable[] =
3649 {
3650 /*	NUL		SOH		STX		ETX	*/
3651 CASE_IGNORE,
3652 CASE_IGNORE,
3653 CASE_IGNORE,
3654 CASE_IGNORE,
3655 /*	EOT		ENQ		ACK		BEL	*/
3656 CASE_IGNORE,
3657 CASE_IGNORE,
3658 CASE_IGNORE,
3659 CASE_BELL,
3660 /*	BS		HT		NL		VT	*/
3661 CASE_BS,
3662 CASE_TAB,
3663 CASE_VMOT,
3664 CASE_VMOT,
3665 /*	NP		CR		SO		SI	*/
3666 CASE_VMOT,
3667 CASE_CR,
3668 CASE_SO,
3669 CASE_SI,
3670 /*	DLE		DC1		DC2		DC3	*/
3671 CASE_IGNORE,
3672 CASE_IGNORE,
3673 CASE_IGNORE,
3674 CASE_IGNORE,
3675 /*	DC4		NAK		SYN		ETB	*/
3676 CASE_IGNORE,
3677 CASE_IGNORE,
3678 CASE_IGNORE,
3679 CASE_IGNORE,
3680 /*	CAN		EM		SUB		ESC	*/
3681 CASE_IGNORE,
3682 CASE_IGNORE,
3683 CASE_IGNORE,
3684 CASE_ESC,
3685 /*	FS		GS		RS		US	*/
3686 CASE_IGNORE,
3687 CASE_IGNORE,
3688 CASE_IGNORE,
3689 CASE_IGNORE,
3690 /*	SP		!		"		#	*/
3691 CASE_ESC_IGNORE,
3692 CASE_ESC_IGNORE,
3693 CASE_ESC_IGNORE,
3694 CASE_ESC_IGNORE,
3695 /*	$		%		&		'	*/
3696 CASE_ESC_IGNORE,
3697 CASE_ESC_IGNORE,
3698 CASE_ESC_IGNORE,
3699 CASE_ESC_IGNORE,
3700 /*	(		)		*		+	*/
3701 CASE_ESC_IGNORE,
3702 CASE_ESC_IGNORE,
3703 CASE_ESC_IGNORE,
3704 CASE_ESC_IGNORE,
3705 /*	,		-		.		/	*/
3706 CASE_ESC_IGNORE,
3707 CASE_ESC_IGNORE,
3708 CASE_ESC_IGNORE,
3709 CASE_ESC_IGNORE,
3710 #ifdef USE_ISO2022
3711 /*	0		1		2		3	*/
3712 CASE_GSETS,
3713 CASE_GSETS,
3714 CASE_GSETS,
3715 CASE_GSETS,
3716 /*	4		5		6		7	*/
3717 CASE_GSETS,
3718 CASE_GSETS,
3719 CASE_GSETS,
3720 CASE_GSETS,
3721 /*	8		9		:		;	*/
3722 CASE_GSETS,
3723 CASE_GSETS,
3724 CASE_GSETS,
3725 CASE_GSETS,
3726 /*	<		=		>		?	*/
3727 CASE_GSETS,
3728 CASE_GSETS,
3729 CASE_GSETS,
3730 CASE_GSETS,
3731 /*	@		A		B		C	*/
3732 CASE_GSETS,
3733 CASE_GSETS,
3734 CASE_GSETS,
3735 CASE_GSETS,
3736 /*	D		E		F		G	*/
3737 CASE_GSETS,
3738 CASE_GSETS,
3739 CASE_GSETS,
3740 CASE_GSETS,
3741 /*	H		I		J		K	*/
3742 CASE_GSETS,
3743 CASE_GSETS,
3744 CASE_GSETS,
3745 CASE_GSETS,
3746 /*	L		M		N		O	*/
3747 CASE_GSETS,
3748 CASE_GSETS,
3749 CASE_GSETS,
3750 CASE_GSETS,
3751 /*	P		Q		R		S	*/
3752 CASE_GSETS,
3753 CASE_GSETS,
3754 CASE_GSETS,
3755 CASE_GSETS,
3756 /*	T		U		V		W	*/
3757 CASE_GSETS,
3758 CASE_GSETS,
3759 CASE_GSETS,
3760 CASE_GSETS,
3761 /*	X		Y		Z		[	*/
3762 CASE_GSETS,
3763 CASE_GSETS,
3764 CASE_GSETS,
3765 CASE_GSETS,
3766 /*	\		]		^		_	*/
3767 CASE_GSETS,
3768 CASE_GSETS,
3769 CASE_GSETS,
3770 CASE_GSETS,
3771 /*	`		a		b		c	*/
3772 CASE_GSETS,
3773 CASE_GSETS,
3774 CASE_GSETS,
3775 CASE_GSETS,
3776 /*	d		e		f		g	*/
3777 CASE_GSETS,
3778 CASE_GSETS,
3779 CASE_GSETS,
3780 CASE_GSETS,
3781 /*	h		i		j		k	*/
3782 CASE_GSETS,
3783 CASE_GSETS,
3784 CASE_GSETS,
3785 CASE_GSETS,
3786 /*	l		m		n		o	*/
3787 CASE_GSETS,
3788 CASE_GSETS,
3789 CASE_GSETS,
3790 CASE_GROUND_STATE, /* GSET('p') >= 0x40 (MBCS flag) */
3791 /*	p		q		r		s	*/
3792 CASE_GROUND_STATE,
3793 CASE_GROUND_STATE,
3794 CASE_GROUND_STATE,
3795 CASE_GROUND_STATE,
3796 /*	t		u		v		w	*/
3797 CASE_GROUND_STATE,
3798 CASE_GROUND_STATE,
3799 CASE_GROUND_STATE,
3800 CASE_GROUND_STATE,
3801 /*	x		y		z		{	*/
3802 CASE_GROUND_STATE,
3803 CASE_GROUND_STATE,
3804 CASE_GROUND_STATE,
3805 CASE_GROUND_STATE,
3806 /*	|		}		~		DEL	*/
3807 CASE_GROUND_STATE,
3808 CASE_GROUND_STATE,
3809 CASE_GROUND_STATE, /* empty character set */
3810 CASE_GROUND_STATE,
3811 #else /* !USE_ISO2022 */
3812 /*	0		1		2		3	*/
3813 CASE_GSETS,
3814 CASE_GSETS,
3815 CASE_GSETS,
3816 CASE_GROUND_STATE,
3817 /*	4		5		6		7	*/
3818 CASE_GROUND_STATE,
3819 CASE_GROUND_STATE,
3820 CASE_GROUND_STATE,
3821 CASE_GROUND_STATE,
3822 /*	8		9		:		;	*/
3823 CASE_GROUND_STATE,
3824 CASE_GROUND_STATE,
3825 CASE_GROUND_STATE,
3826 CASE_GROUND_STATE,
3827 /*	<		=		>		?	*/
3828 CASE_GROUND_STATE,
3829 CASE_GROUND_STATE,
3830 CASE_GROUND_STATE,
3831 CASE_GROUND_STATE,
3832 /*	@		A		B		C	*/
3833 CASE_GROUND_STATE,
3834 CASE_GSETS,
3835 CASE_GSETS,
3836 CASE_GROUND_STATE,
3837 /*	D		E		F		G	*/
3838 CASE_GROUND_STATE,
3839 CASE_GROUND_STATE,
3840 CASE_GROUND_STATE,
3841 CASE_GROUND_STATE,
3842 /*	H		I		J		K	*/
3843 CASE_GROUND_STATE,
3844 CASE_GROUND_STATE,
3845 CASE_GROUND_STATE,
3846 CASE_GROUND_STATE,
3847 /*	L		M		N		O	*/
3848 CASE_GROUND_STATE,
3849 CASE_GROUND_STATE,
3850 CASE_GROUND_STATE,
3851 CASE_GROUND_STATE,
3852 /*	P		Q		R		S	*/
3853 CASE_GROUND_STATE,
3854 CASE_GROUND_STATE,
3855 CASE_GROUND_STATE,
3856 CASE_GROUND_STATE,
3857 /*	T		U		V		W	*/
3858 CASE_GROUND_STATE,
3859 CASE_GROUND_STATE,
3860 CASE_GROUND_STATE,
3861 CASE_GROUND_STATE,
3862 /*	X		Y		Z		[	*/
3863 CASE_GROUND_STATE,
3864 CASE_GROUND_STATE,
3865 CASE_GROUND_STATE,
3866 CASE_GROUND_STATE,
3867 /*	\		]		^		_	*/
3868 CASE_GROUND_STATE,
3869 CASE_GROUND_STATE,
3870 CASE_GROUND_STATE,
3871 CASE_GROUND_STATE,
3872 /*	`		a		b		c	*/
3873 CASE_GROUND_STATE,
3874 CASE_GROUND_STATE,
3875 CASE_GROUND_STATE,
3876 CASE_GROUND_STATE,
3877 /*	d		e		f		g	*/
3878 CASE_GROUND_STATE,
3879 CASE_GROUND_STATE,
3880 CASE_GROUND_STATE,
3881 CASE_GROUND_STATE,
3882 /*	h		i		j		k	*/
3883 CASE_GROUND_STATE,
3884 CASE_GROUND_STATE,
3885 CASE_GROUND_STATE,
3886 CASE_GROUND_STATE,
3887 /*	l		m		n		o	*/
3888 CASE_GROUND_STATE,
3889 CASE_GROUND_STATE,
3890 CASE_GROUND_STATE,
3891 CASE_GROUND_STATE,
3892 /*	p		q		r		s	*/
3893 CASE_GROUND_STATE,
3894 CASE_GROUND_STATE,
3895 CASE_GROUND_STATE,
3896 CASE_GROUND_STATE,
3897 /*	t		u		v		w	*/
3898 CASE_GROUND_STATE,
3899 CASE_GROUND_STATE,
3900 CASE_GROUND_STATE,
3901 CASE_GROUND_STATE,
3902 /*	x		y		z		{	*/
3903 CASE_GROUND_STATE,
3904 CASE_GROUND_STATE,
3905 CASE_GROUND_STATE,
3906 CASE_GROUND_STATE,
3907 /*	|		}		~		DEL	*/
3908 CASE_GROUND_STATE,
3909 CASE_GROUND_STATE,
3910 CASE_GROUND_STATE,
3911 CASE_GROUND_STATE,
3912 #endif /* !USE_ISO2022 */
3913 /*      0x80            0x81            0x82            0x83    */
3914 CASE_IGNORE,
3915 CASE_IGNORE,
3916 CASE_IGNORE,
3917 CASE_IGNORE,
3918 /*      0x84            0x85            0x86            0x87    */
3919 CASE_IGNORE,
3920 CASE_IGNORE,
3921 CASE_IGNORE,
3922 CASE_IGNORE,
3923 /*      0x88            0x89            0x8a            0x8b    */
3924 CASE_IGNORE,
3925 CASE_IGNORE,
3926 CASE_IGNORE,
3927 CASE_IGNORE,
3928 /*      0x8c            0x8d            0x8e            0x8f    */
3929 CASE_IGNORE,
3930 CASE_IGNORE,
3931 CASE_IGNORE,
3932 CASE_IGNORE,
3933 /*      0x90            0x91            0x92            0x93    */
3934 CASE_IGNORE,
3935 CASE_IGNORE,
3936 CASE_IGNORE,
3937 CASE_IGNORE,
3938 /*      0x94            0x95            0x96            0x97    */
3939 CASE_IGNORE,
3940 CASE_IGNORE,
3941 CASE_IGNORE,
3942 CASE_IGNORE,
3943 /*      0x99            0x99            0x9a            0x9b    */
3944 CASE_IGNORE,
3945 CASE_IGNORE,
3946 CASE_IGNORE,
3947 CASE_IGNORE,
3948 /*      0x9c            0x9d            0x9e            0x9f    */
3949 CASE_IGNORE,
3950 CASE_IGNORE,
3951 CASE_IGNORE,
3952 CASE_IGNORE,
3953 /*      nobreakspace    exclamdown      cent            sterling        */
3954 CASE_GROUND_STATE,
3955 CASE_GROUND_STATE,
3956 CASE_GROUND_STATE,
3957 CASE_GROUND_STATE,
3958 /*      currency        yen             brokenbar       section         */
3959 CASE_GROUND_STATE,
3960 CASE_GROUND_STATE,
3961 CASE_GROUND_STATE,
3962 CASE_GROUND_STATE,
3963 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
3964 CASE_GROUND_STATE,
3965 CASE_GROUND_STATE,
3966 CASE_GROUND_STATE,
3967 CASE_GROUND_STATE,
3968 /*      notsign         hyphen          registered      macron          */
3969 CASE_GROUND_STATE,
3970 CASE_GROUND_STATE,
3971 CASE_GROUND_STATE,
3972 CASE_GROUND_STATE,
3973 /*      degree          plusminus       twosuperior     threesuperior   */
3974 CASE_GROUND_STATE,
3975 CASE_GROUND_STATE,
3976 CASE_GROUND_STATE,
3977 CASE_GROUND_STATE,
3978 /*      acute           mu              paragraph       periodcentered  */
3979 CASE_GROUND_STATE,
3980 CASE_GROUND_STATE,
3981 CASE_GROUND_STATE,
3982 CASE_GROUND_STATE,
3983 /*      cedilla         onesuperior     masculine       guillemotright  */
3984 CASE_GROUND_STATE,
3985 CASE_GROUND_STATE,
3986 CASE_GROUND_STATE,
3987 CASE_GROUND_STATE,
3988 /*      onequarter      onehalf         threequarters   questiondown    */
3989 CASE_GROUND_STATE,
3990 CASE_GROUND_STATE,
3991 CASE_GROUND_STATE,
3992 CASE_GROUND_STATE,
3993 /*      Agrave          Aacute          Acircumflex     Atilde          */
3994 CASE_GROUND_STATE,
3995 CASE_GROUND_STATE,
3996 CASE_GROUND_STATE,
3997 CASE_GROUND_STATE,
3998 /*      Adiaeresis      Aring           AE              Ccedilla        */
3999 CASE_GROUND_STATE,
4000 CASE_GROUND_STATE,
4001 CASE_GROUND_STATE,
4002 CASE_GROUND_STATE,
4003 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
4004 CASE_GROUND_STATE,
4005 CASE_GROUND_STATE,
4006 CASE_GROUND_STATE,
4007 CASE_GROUND_STATE,
4008 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
4009 CASE_GROUND_STATE,
4010 CASE_GROUND_STATE,
4011 CASE_GROUND_STATE,
4012 CASE_GROUND_STATE,
4013 /*      Eth             Ntilde          Ograve          Oacute          */
4014 CASE_GROUND_STATE,
4015 CASE_GROUND_STATE,
4016 CASE_GROUND_STATE,
4017 CASE_GROUND_STATE,
4018 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
4019 CASE_GROUND_STATE,
4020 CASE_GROUND_STATE,
4021 CASE_GROUND_STATE,
4022 CASE_GROUND_STATE,
4023 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
4024 CASE_GROUND_STATE,
4025 CASE_GROUND_STATE,
4026 CASE_GROUND_STATE,
4027 CASE_GROUND_STATE,
4028 /*      Udiaeresis      Yacute          Thorn           ssharp          */
4029 CASE_GROUND_STATE,
4030 CASE_GROUND_STATE,
4031 CASE_GROUND_STATE,
4032 CASE_GROUND_STATE,
4033 /*      agrave          aacute          acircumflex     atilde          */
4034 CASE_GROUND_STATE,
4035 CASE_GROUND_STATE,
4036 CASE_GROUND_STATE,
4037 CASE_GROUND_STATE,
4038 /*      adiaeresis      aring           ae              ccedilla        */
4039 CASE_GROUND_STATE,
4040 CASE_GROUND_STATE,
4041 CASE_GROUND_STATE,
4042 CASE_GROUND_STATE,
4043 /*      egrave          eacute          ecircumflex     ediaeresis      */
4044 CASE_GROUND_STATE,
4045 CASE_GROUND_STATE,
4046 CASE_GROUND_STATE,
4047 CASE_GROUND_STATE,
4048 /*      igrave          iacute          icircumflex     idiaeresis      */
4049 CASE_GROUND_STATE,
4050 CASE_GROUND_STATE,
4051 CASE_GROUND_STATE,
4052 CASE_GROUND_STATE,
4053 /*      eth             ntilde          ograve          oacute          */
4054 CASE_GROUND_STATE,
4055 CASE_GROUND_STATE,
4056 CASE_GROUND_STATE,
4057 CASE_GROUND_STATE,
4058 /*      ocircumflex     otilde          odiaeresis      division        */
4059 CASE_GROUND_STATE,
4060 CASE_GROUND_STATE,
4061 CASE_GROUND_STATE,
4062 CASE_GROUND_STATE,
4063 /*      oslash          ugrave          uacute          ucircumflex     */
4064 CASE_GROUND_STATE,
4065 CASE_GROUND_STATE,
4066 CASE_GROUND_STATE,
4067 CASE_GROUND_STATE,
4068 /*      udiaeresis      yacute          thorn           ydiaeresis      */
4069 CASE_GROUND_STATE,
4070 CASE_GROUND_STATE,
4071 CASE_GROUND_STATE,
4072 CASE_GROUND_STATE,
4073 };
4074 
4075 #ifdef USE_MBCS
4076 // #pragma mark MBCS table
4077 int gMbcsTable[] = {
4078 /*	NUL		SOH		STX		ETX	*/
4079 CASE_IGNORE,
4080 CASE_IGNORE,
4081 CASE_IGNORE,
4082 CASE_IGNORE,
4083 /*	EOT		ENQ		ACK		BEL	*/
4084 CASE_IGNORE,
4085 CASE_IGNORE,
4086 CASE_IGNORE,
4087 CASE_BELL,
4088 /*	BS		HT		NL		VT	*/
4089 CASE_BS,
4090 CASE_TAB,
4091 CASE_VMOT,
4092 CASE_VMOT,
4093 /*	NP		CR		SO		SI	*/
4094 CASE_VMOT,
4095 CASE_CR,
4096 CASE_SO,
4097 CASE_SI,
4098 /*	DLE		DC1		DC2		DC3	*/
4099 CASE_IGNORE,
4100 CASE_IGNORE,
4101 CASE_IGNORE,
4102 CASE_IGNORE,
4103 /*	DC4		NAK		SYN		ETB	*/
4104 CASE_IGNORE,
4105 CASE_IGNORE,
4106 CASE_IGNORE,
4107 CASE_IGNORE,
4108 /*	CAN		EM		SUB		ESC	*/
4109 CASE_IGNORE,
4110 CASE_IGNORE,
4111 CASE_IGNORE,
4112 CASE_ESC,
4113 /*	FS		GS		RS		US	*/
4114 CASE_IGNORE,
4115 CASE_IGNORE,
4116 CASE_IGNORE,
4117 CASE_IGNORE,
4118 /*	SP		!		"		#	*/
4119 CASE_ESC_IGNORE,
4120 CASE_ESC_IGNORE,
4121 CASE_ESC_IGNORE,
4122 CASE_ESC_IGNORE,
4123 /*	$		%		&		'	*/
4124 CASE_ESC_IGNORE,
4125 CASE_ESC_IGNORE,
4126 CASE_ESC_IGNORE,
4127 CASE_ESC_IGNORE,
4128 /*	(		)		*		+	*/
4129 CASE_IGNORE, /*CASE_SCS_STATE,*/
4130 CASE_SCS_STATE,
4131 CASE_SCS_STATE,
4132 CASE_SCS_STATE,
4133 /*	,		-		.		/	*/
4134 CASE_ESC_IGNORE,
4135 CASE_SCS_STATE,
4136 CASE_SCS_STATE,
4137 CASE_SCS_STATE,
4138 /*	0		1		2		3	*/
4139 CASE_GROUND_STATE,
4140 CASE_GROUND_STATE,
4141 CASE_GROUND_STATE,
4142 CASE_GROUND_STATE,
4143 /*	4		5		6		7	*/
4144 CASE_GROUND_STATE,
4145 CASE_GROUND_STATE,
4146 CASE_GROUND_STATE,
4147 CASE_GROUND_STATE,
4148 /*	8		9		:		;	*/
4149 CASE_GROUND_STATE,
4150 CASE_GROUND_STATE,
4151 CASE_GROUND_STATE,
4152 CASE_GROUND_STATE,
4153 /*	<		=		>		?	*/
4154 CASE_GROUND_STATE,
4155 CASE_GROUND_STATE,
4156 CASE_GROUND_STATE,
4157 CASE_GROUND_STATE,
4158 /*	@		A		B		C	*/
4159 CASE_GSETS,	/* ESC-$-@ (JIS-78) */
4160 CASE_GSETS,	/* ESC-$-A (GB) */
4161 CASE_GSETS,	/* ESC-$-B (JIS-83) */
4162 CASE_GROUND_STATE,
4163 /*	D		E		F		G	*/
4164 CASE_GROUND_STATE,
4165 CASE_GROUND_STATE,
4166 CASE_GROUND_STATE,
4167 CASE_GROUND_STATE,
4168 /*	H		I		J		K	*/
4169 CASE_GROUND_STATE,
4170 CASE_GROUND_STATE,
4171 CASE_GROUND_STATE,
4172 CASE_GROUND_STATE,
4173 /*	L		M		N		O	*/
4174 CASE_GROUND_STATE,
4175 CASE_GROUND_STATE,
4176 CASE_GROUND_STATE,
4177 CASE_GROUND_STATE,
4178 /*	P		Q		R		S	*/
4179 CASE_IGNORE_STATE,
4180 CASE_GROUND_STATE,
4181 CASE_GROUND_STATE,
4182 CASE_GROUND_STATE,
4183 /*	T		U		V		W	*/
4184 CASE_GROUND_STATE,
4185 CASE_GROUND_STATE,
4186 CASE_GROUND_STATE,
4187 CASE_GROUND_STATE,
4188 /*	X		Y		Z		[	*/
4189 CASE_GROUND_STATE,
4190 CASE_GROUND_STATE,
4191 CASE_GROUND_STATE,
4192 CASE_GROUND_STATE,
4193 /*	\		]		^		_	*/
4194 CASE_GROUND_STATE,
4195 CASE_GROUND_STATE,
4196 CASE_IGNORE_STATE,
4197 CASE_IGNORE_STATE,
4198 /*	`		a		b		c	*/
4199 CASE_GROUND_STATE,
4200 CASE_GROUND_STATE,
4201 CASE_GROUND_STATE,
4202 CASE_GROUND_STATE,
4203 /*	d		e		f		g	*/
4204 CASE_GROUND_STATE,
4205 CASE_GROUND_STATE,
4206 CASE_GROUND_STATE,
4207 CASE_GROUND_STATE,
4208 /*	h		i		j		k	*/
4209 CASE_GROUND_STATE,
4210 CASE_GROUND_STATE,
4211 CASE_GROUND_STATE,
4212 CASE_GROUND_STATE,
4213 /*	l		m		n		o	*/
4214 CASE_GROUND_STATE,
4215 CASE_GROUND_STATE,
4216 CASE_GROUND_STATE,
4217 CASE_GROUND_STATE,
4218 /*	p		q		r		s	*/
4219 CASE_GROUND_STATE,
4220 CASE_GROUND_STATE,
4221 CASE_GROUND_STATE,
4222 CASE_GROUND_STATE,
4223 /*	t		u		v		w	*/
4224 CASE_GROUND_STATE,
4225 CASE_GROUND_STATE,
4226 CASE_GROUND_STATE,
4227 CASE_GROUND_STATE,
4228 /*	x		y		z		{	*/
4229 CASE_GROUND_STATE,
4230 CASE_GROUND_STATE,
4231 CASE_GROUND_STATE,
4232 CASE_GROUND_STATE,
4233 /*	|		}		~		DEL	*/
4234 CASE_GROUND_STATE,
4235 CASE_GROUND_STATE,
4236 CASE_GROUND_STATE,
4237 CASE_GROUND_STATE,
4238 /*      0x80            0x81            0x82            0x83    */
4239 CASE_IGNORE,
4240 CASE_IGNORE,
4241 CASE_IGNORE,
4242 CASE_IGNORE,
4243 /*      0x84            0x85            0x86            0x87    */
4244 CASE_IGNORE,
4245 CASE_IGNORE,
4246 CASE_IGNORE,
4247 CASE_IGNORE,
4248 /*      0x88            0x89            0x8a            0x8b    */
4249 CASE_IGNORE,
4250 CASE_IGNORE,
4251 CASE_IGNORE,
4252 CASE_IGNORE,
4253 /*      0x8c            0x8d            0x8e            0x8f    */
4254 CASE_IGNORE,
4255 CASE_IGNORE,
4256 CASE_IGNORE,
4257 CASE_IGNORE,
4258 /*      0x90            0x91            0x92            0x93    */
4259 CASE_IGNORE,
4260 CASE_IGNORE,
4261 CASE_IGNORE,
4262 CASE_IGNORE,
4263 /*      0x94            0x95            0x96            0x97    */
4264 CASE_IGNORE,
4265 CASE_IGNORE,
4266 CASE_IGNORE,
4267 CASE_IGNORE,
4268 /*      0x99            0x99            0x9a            0x9b    */
4269 CASE_IGNORE,
4270 CASE_IGNORE,
4271 CASE_IGNORE,
4272 CASE_IGNORE,
4273 /*      0x9c            0x9d            0x9e            0x9f    */
4274 CASE_IGNORE,
4275 CASE_IGNORE,
4276 CASE_IGNORE,
4277 CASE_IGNORE,
4278 /*      nobreakspace    exclamdown      cent            sterling        */
4279 CASE_GROUND_STATE,
4280 CASE_GROUND_STATE,
4281 CASE_GROUND_STATE,
4282 CASE_GROUND_STATE,
4283 /*      currency        yen             brokenbar       section         */
4284 CASE_GROUND_STATE,
4285 CASE_GROUND_STATE,
4286 CASE_GROUND_STATE,
4287 CASE_GROUND_STATE,
4288 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
4289 CASE_GROUND_STATE,
4290 CASE_GROUND_STATE,
4291 CASE_GROUND_STATE,
4292 CASE_GROUND_STATE,
4293 /*      notsign         hyphen          registered      macron          */
4294 CASE_GROUND_STATE,
4295 CASE_GROUND_STATE,
4296 CASE_GROUND_STATE,
4297 CASE_GROUND_STATE,
4298 /*      degree          plusminus       twosuperior     threesuperior   */
4299 CASE_GROUND_STATE,
4300 CASE_GROUND_STATE,
4301 CASE_GROUND_STATE,
4302 CASE_GROUND_STATE,
4303 /*      acute           mu              paragraph       periodcentered  */
4304 CASE_GROUND_STATE,
4305 CASE_GROUND_STATE,
4306 CASE_GROUND_STATE,
4307 CASE_GROUND_STATE,
4308 /*      cedilla         onesuperior     masculine       guillemotright  */
4309 CASE_GROUND_STATE,
4310 CASE_GROUND_STATE,
4311 CASE_GROUND_STATE,
4312 CASE_GROUND_STATE,
4313 /*      onequarter      onehalf         threequarters   questiondown    */
4314 CASE_GROUND_STATE,
4315 CASE_GROUND_STATE,
4316 CASE_GROUND_STATE,
4317 CASE_GROUND_STATE,
4318 /*      Agrave          Aacute          Acircumflex     Atilde          */
4319 CASE_GROUND_STATE,
4320 CASE_GROUND_STATE,
4321 CASE_GROUND_STATE,
4322 CASE_GROUND_STATE,
4323 /*      Adiaeresis      Aring           AE              Ccedilla        */
4324 CASE_GROUND_STATE,
4325 CASE_GROUND_STATE,
4326 CASE_GROUND_STATE,
4327 CASE_GROUND_STATE,
4328 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
4329 CASE_GROUND_STATE,
4330 CASE_GROUND_STATE,
4331 CASE_GROUND_STATE,
4332 CASE_GROUND_STATE,
4333 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
4334 CASE_GROUND_STATE,
4335 CASE_GROUND_STATE,
4336 CASE_GROUND_STATE,
4337 CASE_GROUND_STATE,
4338 /*      Eth             Ntilde          Ograve          Oacute          */
4339 CASE_GROUND_STATE,
4340 CASE_GROUND_STATE,
4341 CASE_GROUND_STATE,
4342 CASE_GROUND_STATE,
4343 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
4344 CASE_GROUND_STATE,
4345 CASE_GROUND_STATE,
4346 CASE_GROUND_STATE,
4347 CASE_GROUND_STATE,
4348 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
4349 CASE_GROUND_STATE,
4350 CASE_GROUND_STATE,
4351 CASE_GROUND_STATE,
4352 CASE_GROUND_STATE,
4353 /*      Udiaeresis      Yacute          Thorn           ssharp          */
4354 CASE_GROUND_STATE,
4355 CASE_GROUND_STATE,
4356 CASE_GROUND_STATE,
4357 CASE_GROUND_STATE,
4358 /*      agrave          aacute          acircumflex     atilde          */
4359 CASE_GROUND_STATE,
4360 CASE_GROUND_STATE,
4361 CASE_GROUND_STATE,
4362 CASE_GROUND_STATE,
4363 /*      adiaeresis      aring           ae              ccedilla        */
4364 CASE_GROUND_STATE,
4365 CASE_GROUND_STATE,
4366 CASE_GROUND_STATE,
4367 CASE_GROUND_STATE,
4368 /*      egrave          eacute          ecircumflex     ediaeresis      */
4369 CASE_GROUND_STATE,
4370 CASE_GROUND_STATE,
4371 CASE_GROUND_STATE,
4372 CASE_GROUND_STATE,
4373 /*      igrave          iacute          icircumflex     idiaeresis      */
4374 CASE_GROUND_STATE,
4375 CASE_GROUND_STATE,
4376 CASE_GROUND_STATE,
4377 CASE_GROUND_STATE,
4378 /*      eth             ntilde          ograve          oacute          */
4379 CASE_GROUND_STATE,
4380 CASE_GROUND_STATE,
4381 CASE_GROUND_STATE,
4382 CASE_GROUND_STATE,
4383 /*      ocircumflex     otilde          odiaeresis      division        */
4384 CASE_GROUND_STATE,
4385 CASE_GROUND_STATE,
4386 CASE_GROUND_STATE,
4387 CASE_GROUND_STATE,
4388 /*      oslash          ugrave          uacute          ucircumflex     */
4389 CASE_GROUND_STATE,
4390 CASE_GROUND_STATE,
4391 CASE_GROUND_STATE,
4392 CASE_GROUND_STATE,
4393 /*      udiaeresis      yacute          thorn           ydiaeresis      */
4394 CASE_GROUND_STATE,
4395 CASE_GROUND_STATE,
4396 CASE_GROUND_STATE,
4397 CASE_GROUND_STATE,
4398 };
4399 
4400 // #pragma mark SMBCS table
4401 int gSmbcsTable[] = {
4402 /*	NUL		SOH		STX		ETX	*/
4403 CASE_IGNORE,
4404 CASE_IGNORE,
4405 CASE_IGNORE,
4406 CASE_IGNORE,
4407 /*	EOT		ENQ		ACK		BEL	*/
4408 CASE_IGNORE,
4409 CASE_IGNORE,
4410 CASE_IGNORE,
4411 CASE_BELL,
4412 /*	BS		HT		NL		VT	*/
4413 CASE_BS,
4414 CASE_TAB,
4415 CASE_VMOT,
4416 CASE_VMOT,
4417 /*	NP		CR		SO		SI	*/
4418 CASE_VMOT,
4419 CASE_CR,
4420 CASE_SO,
4421 CASE_SI,
4422 /*	DLE		DC1		DC2		DC3	*/
4423 CASE_IGNORE,
4424 CASE_IGNORE,
4425 CASE_IGNORE,
4426 CASE_IGNORE,
4427 /*	DC4		NAK		SYN		ETB	*/
4428 CASE_IGNORE,
4429 CASE_IGNORE,
4430 CASE_IGNORE,
4431 CASE_IGNORE,
4432 /*	CAN		EM		SUB		ESC	*/
4433 CASE_IGNORE,
4434 CASE_IGNORE,
4435 CASE_IGNORE,
4436 CASE_ESC,
4437 /*	FS		GS		RS		US	*/
4438 CASE_IGNORE,
4439 CASE_IGNORE,
4440 CASE_IGNORE,
4441 CASE_IGNORE,
4442 /*	SP		!		"		#	*/
4443 CASE_ESC_IGNORE,
4444 CASE_ESC_IGNORE,
4445 CASE_ESC_IGNORE,
4446 CASE_ESC_IGNORE,
4447 /*	$		%		&		'	*/
4448 CASE_ESC_IGNORE,
4449 CASE_ESC_IGNORE,
4450 CASE_ESC_IGNORE,
4451 CASE_ESC_IGNORE,
4452 /*	(		)		*		+	*/
4453 CASE_ESC_IGNORE,
4454 CASE_ESC_IGNORE,
4455 CASE_ESC_IGNORE,
4456 CASE_ESC_IGNORE,
4457 /*	,		-		.		/	*/
4458 CASE_ESC_IGNORE,
4459 CASE_ESC_IGNORE,
4460 CASE_ESC_IGNORE,
4461 CASE_ESC_IGNORE,
4462 /*	0		1		2		3	*/
4463 CASE_GROUND_STATE, /* (2-byte or more) private character set */
4464 CASE_GROUND_STATE,
4465 CASE_GROUND_STATE,
4466 CASE_GROUND_STATE,
4467 /*	4		5		6		7	*/
4468 CASE_GROUND_STATE,
4469 CASE_GROUND_STATE,
4470 CASE_GROUND_STATE,
4471 CASE_GROUND_STATE,
4472 /*	8		9		:		;	*/
4473 CASE_GROUND_STATE,
4474 CASE_GROUND_STATE,
4475 CASE_GROUND_STATE,
4476 CASE_GROUND_STATE,
4477 /*	<		=		>		?	*/
4478 CASE_GROUND_STATE,
4479 CASE_GROUND_STATE,
4480 CASE_GROUND_STATE,
4481 CASE_GROUND_STATE,
4482 /*	@		A		B		C	*/
4483 CASE_GSETS,	/* ESC-$-I-F */
4484 CASE_GSETS,
4485 CASE_GSETS,
4486 CASE_GSETS,
4487 /*	D		E		F		G	*/
4488 CASE_GSETS,
4489 CASE_GSETS,
4490 CASE_GSETS,
4491 CASE_GSETS,
4492 /*	H		I		J		K	*/
4493 CASE_GSETS,
4494 CASE_GSETS,
4495 CASE_GSETS,
4496 CASE_GSETS,
4497 /*	L		M		N		O	*/
4498 CASE_GSETS,
4499 CASE_GSETS,
4500 CASE_GSETS,
4501 CASE_GSETS,
4502 /*	P		Q		R		S	*/
4503 CASE_GSETS,
4504 CASE_GSETS,
4505 CASE_GSETS,
4506 CASE_GSETS,
4507 /*	T		U		V		W	*/
4508 CASE_GSETS,
4509 CASE_GSETS,
4510 CASE_GSETS,
4511 CASE_GSETS,
4512 /*	X		Y		Z		[	*/
4513 CASE_GSETS,
4514 CASE_GSETS,
4515 CASE_GSETS,
4516 CASE_GSETS,
4517 /*	\		]		^		_	*/
4518 CASE_GSETS,
4519 CASE_GSETS,
4520 CASE_GSETS,
4521 CASE_GSETS,
4522 /*	`		a		b		c	*/
4523 CASE_GROUND_STATE, /* 3-byte character set */
4524 CASE_GROUND_STATE,
4525 CASE_GROUND_STATE,
4526 CASE_GROUND_STATE,
4527 /*	d		e		f		g	*/
4528 CASE_GROUND_STATE,
4529 CASE_GROUND_STATE,
4530 CASE_GROUND_STATE,
4531 CASE_GROUND_STATE,
4532 /*	h		i		j		k	*/
4533 CASE_GROUND_STATE,
4534 CASE_GROUND_STATE,
4535 CASE_GROUND_STATE,
4536 CASE_GROUND_STATE,
4537 /*	l		m		n		o	*/
4538 CASE_GROUND_STATE,
4539 CASE_GROUND_STATE,
4540 CASE_GROUND_STATE,
4541 CASE_GROUND_STATE,
4542 /*	p		q		r		s	*/
4543 CASE_GROUND_STATE, /* 4-byte character set */
4544 CASE_GROUND_STATE,
4545 CASE_GROUND_STATE,
4546 CASE_GROUND_STATE,
4547 /*	t		u		v		w	*/
4548 CASE_GROUND_STATE,
4549 CASE_GROUND_STATE,
4550 CASE_GROUND_STATE,
4551 CASE_GROUND_STATE,
4552 /*	x		y		z		{	*/
4553 CASE_GROUND_STATE,
4554 CASE_GROUND_STATE,
4555 CASE_GROUND_STATE,
4556 CASE_GROUND_STATE,
4557 /*	|		}		~		DEL	*/
4558 CASE_GROUND_STATE,
4559 CASE_GROUND_STATE,
4560 CASE_GROUND_STATE,
4561 CASE_GROUND_STATE,
4562 /*      0x80            0x81            0x82            0x83    */
4563 CASE_IGNORE,
4564 CASE_IGNORE,
4565 CASE_IGNORE,
4566 CASE_IGNORE,
4567 /*      0x84            0x85            0x86            0x87    */
4568 CASE_IGNORE,
4569 CASE_IGNORE,
4570 CASE_IGNORE,
4571 CASE_IGNORE,
4572 /*      0x88            0x89            0x8a            0x8b    */
4573 CASE_IGNORE,
4574 CASE_IGNORE,
4575 CASE_IGNORE,
4576 CASE_IGNORE,
4577 /*      0x8c            0x8d            0x8e            0x8f    */
4578 CASE_IGNORE,
4579 CASE_IGNORE,
4580 CASE_IGNORE,
4581 CASE_IGNORE,
4582 /*      0x90            0x91            0x92            0x93    */
4583 CASE_IGNORE,
4584 CASE_IGNORE,
4585 CASE_IGNORE,
4586 CASE_IGNORE,
4587 /*      0x94            0x95            0x96            0x97    */
4588 CASE_IGNORE,
4589 CASE_IGNORE,
4590 CASE_IGNORE,
4591 CASE_IGNORE,
4592 /*      0x99            0x99            0x9a            0x9b    */
4593 CASE_IGNORE,
4594 CASE_IGNORE,
4595 CASE_IGNORE,
4596 CASE_IGNORE,
4597 /*      0x9c            0x9d            0x9e            0x9f    */
4598 CASE_IGNORE,
4599 CASE_IGNORE,
4600 CASE_IGNORE,
4601 CASE_IGNORE,
4602 /*      nobreakspace    exclamdown      cent            sterling        */
4603 CASE_GROUND_STATE,
4604 CASE_GROUND_STATE,
4605 CASE_GROUND_STATE,
4606 CASE_GROUND_STATE,
4607 /*      currency        yen             brokenbar       section         */
4608 CASE_GROUND_STATE,
4609 CASE_GROUND_STATE,
4610 CASE_GROUND_STATE,
4611 CASE_GROUND_STATE,
4612 /*      diaeresis       copyright       ordfeminine     guillemotleft   */
4613 CASE_GROUND_STATE,
4614 CASE_GROUND_STATE,
4615 CASE_GROUND_STATE,
4616 CASE_GROUND_STATE,
4617 /*      notsign         hyphen          registered      macron          */
4618 CASE_GROUND_STATE,
4619 CASE_GROUND_STATE,
4620 CASE_GROUND_STATE,
4621 CASE_GROUND_STATE,
4622 /*      degree          plusminus       twosuperior     threesuperior   */
4623 CASE_GROUND_STATE,
4624 CASE_GROUND_STATE,
4625 CASE_GROUND_STATE,
4626 CASE_GROUND_STATE,
4627 /*      acute           mu              paragraph       periodcentered  */
4628 CASE_GROUND_STATE,
4629 CASE_GROUND_STATE,
4630 CASE_GROUND_STATE,
4631 CASE_GROUND_STATE,
4632 /*      cedilla         onesuperior     masculine       guillemotright  */
4633 CASE_GROUND_STATE,
4634 CASE_GROUND_STATE,
4635 CASE_GROUND_STATE,
4636 CASE_GROUND_STATE,
4637 /*      onequarter      onehalf         threequarters   questiondown    */
4638 CASE_GROUND_STATE,
4639 CASE_GROUND_STATE,
4640 CASE_GROUND_STATE,
4641 CASE_GROUND_STATE,
4642 /*      Agrave          Aacute          Acircumflex     Atilde          */
4643 CASE_GROUND_STATE,
4644 CASE_GROUND_STATE,
4645 CASE_GROUND_STATE,
4646 CASE_GROUND_STATE,
4647 /*      Adiaeresis      Aring           AE              Ccedilla        */
4648 CASE_GROUND_STATE,
4649 CASE_GROUND_STATE,
4650 CASE_GROUND_STATE,
4651 CASE_GROUND_STATE,
4652 /*      Egrave          Eacute          Ecircumflex     Ediaeresis      */
4653 CASE_GROUND_STATE,
4654 CASE_GROUND_STATE,
4655 CASE_GROUND_STATE,
4656 CASE_GROUND_STATE,
4657 /*      Igrave          Iacute          Icircumflex     Idiaeresis      */
4658 CASE_GROUND_STATE,
4659 CASE_GROUND_STATE,
4660 CASE_GROUND_STATE,
4661 CASE_GROUND_STATE,
4662 /*      Eth             Ntilde          Ograve          Oacute          */
4663 CASE_GROUND_STATE,
4664 CASE_GROUND_STATE,
4665 CASE_GROUND_STATE,
4666 CASE_GROUND_STATE,
4667 /*      Ocircumflex     Otilde          Odiaeresis      multiply        */
4668 CASE_GROUND_STATE,
4669 CASE_GROUND_STATE,
4670 CASE_GROUND_STATE,
4671 CASE_GROUND_STATE,
4672 /*      Ooblique        Ugrave          Uacute          Ucircumflex     */
4673 CASE_GROUND_STATE,
4674 CASE_GROUND_STATE,
4675 CASE_GROUND_STATE,
4676 CASE_GROUND_STATE,
4677 /*      Udiaeresis      Yacute          Thorn           ssharp          */
4678 CASE_GROUND_STATE,
4679 CASE_GROUND_STATE,
4680 CASE_GROUND_STATE,
4681 CASE_GROUND_STATE,
4682 /*      agrave          aacute          acircumflex     atilde          */
4683 CASE_GROUND_STATE,
4684 CASE_GROUND_STATE,
4685 CASE_GROUND_STATE,
4686 CASE_GROUND_STATE,
4687 /*      adiaeresis      aring           ae              ccedilla        */
4688 CASE_GROUND_STATE,
4689 CASE_GROUND_STATE,
4690 CASE_GROUND_STATE,
4691 CASE_GROUND_STATE,
4692 /*      egrave          eacute          ecircumflex     ediaeresis      */
4693 CASE_GROUND_STATE,
4694 CASE_GROUND_STATE,
4695 CASE_GROUND_STATE,
4696 CASE_GROUND_STATE,
4697 /*      igrave          iacute          icircumflex     idiaeresis      */
4698 CASE_GROUND_STATE,
4699 CASE_GROUND_STATE,
4700 CASE_GROUND_STATE,
4701 CASE_GROUND_STATE,
4702 /*      eth             ntilde          ograve          oacute          */
4703 CASE_GROUND_STATE,
4704 CASE_GROUND_STATE,
4705 CASE_GROUND_STATE,
4706 CASE_GROUND_STATE,
4707 /*      ocircumflex     otilde          odiaeresis      division        */
4708 CASE_GROUND_STATE,
4709 CASE_GROUND_STATE,
4710 CASE_GROUND_STATE,
4711 CASE_GROUND_STATE,
4712 /*      oslash          ugrave          uacute          ucircumflex     */
4713 CASE_GROUND_STATE,
4714 CASE_GROUND_STATE,
4715 CASE_GROUND_STATE,
4716 CASE_GROUND_STATE,
4717 /*      udiaeresis      yacute          thorn           ydiaeresis      */
4718 CASE_GROUND_STATE,
4719 CASE_GROUND_STATE,
4720 CASE_GROUND_STATE,
4721 CASE_GROUND_STATE,
4722 };
4723 
4724 #endif
4725 
4726 // #pragma mark Shift-JIS ground table
4727 int gSJISGroundTable[] =
4728 {
4729 /*	NUL		SOH		STX		ETX	*/
4730 CASE_IGNORE,
4731 CASE_IGNORE,
4732 CASE_IGNORE,
4733 CASE_IGNORE,
4734 /*	EOT		ENQ		ACK		BEL	*/
4735 CASE_IGNORE,
4736 CASE_IGNORE,
4737 CASE_IGNORE,
4738 CASE_BELL,
4739 /*	BS		HT		NL		VT	*/
4740 CASE_BS,
4741 CASE_TAB,
4742 CASE_LF,
4743 CASE_LF, /*CASE_UP,*/
4744 /*	NP		CR		SO		SI	*/
4745 CASE_LF, /*CASE_IGNORE,*/
4746 CASE_CR,
4747 CASE_SO,
4748 CASE_SI,
4749 /*	DLE		DC1		DC2		DC3	*/
4750 CASE_IGNORE,
4751 CASE_IGNORE,
4752 CASE_IGNORE,
4753 CASE_IGNORE,
4754 /*	DC4		NAK		SYN		ETB	*/
4755 CASE_IGNORE,
4756 CASE_IGNORE,
4757 CASE_IGNORE,
4758 CASE_IGNORE,
4759 /*	CAN		EM		SUB		ESC	*/
4760 CASE_IGNORE,
4761 CASE_IGNORE,
4762 CASE_IGNORE,
4763 CASE_ESC,
4764 /*	FS		GS		RS		US	*/
4765 CASE_IGNORE,
4766 CASE_IGNORE,
4767 CASE_IGNORE,
4768 CASE_IGNORE,
4769 /*	SP		!		"		#	*/
4770 CASE_PRINT,
4771 CASE_PRINT,
4772 CASE_PRINT,
4773 CASE_PRINT,
4774 /*	$		%		&		'	*/
4775 CASE_PRINT,
4776 CASE_PRINT,
4777 CASE_PRINT,
4778 CASE_PRINT,
4779 /*	(		)		*		+	*/
4780 CASE_PRINT,
4781 CASE_PRINT,
4782 CASE_PRINT,
4783 CASE_PRINT,
4784 /*	,		-		.		/	*/
4785 CASE_PRINT,
4786 CASE_PRINT,
4787 CASE_PRINT,
4788 CASE_PRINT,
4789 /*	0		1		2		3	*/
4790 CASE_PRINT,
4791 CASE_PRINT,
4792 CASE_PRINT,
4793 CASE_PRINT,
4794 /*	4		5		6		7	*/
4795 CASE_PRINT,
4796 CASE_PRINT,
4797 CASE_PRINT,
4798 CASE_PRINT,
4799 /*	8		9		:		;	*/
4800 CASE_PRINT,
4801 CASE_PRINT,
4802 CASE_PRINT,
4803 CASE_PRINT,
4804 /*	<		=		>		?	*/
4805 CASE_PRINT,
4806 CASE_PRINT,
4807 CASE_PRINT,
4808 CASE_PRINT,
4809 /*	@		A		B		C	*/
4810 CASE_PRINT,
4811 CASE_PRINT,
4812 CASE_PRINT,
4813 CASE_PRINT,
4814 /*	D		E		F		G	*/
4815 CASE_PRINT,
4816 CASE_PRINT,
4817 CASE_PRINT,
4818 CASE_PRINT,
4819 /*	H		I		J		K	*/
4820 CASE_PRINT,
4821 CASE_PRINT,
4822 CASE_PRINT,
4823 CASE_PRINT,
4824 /*	L		M		N		O	*/
4825 CASE_PRINT,
4826 CASE_PRINT,
4827 CASE_PRINT,
4828 CASE_PRINT,
4829 /*	P		Q		R		S	*/
4830 CASE_PRINT,
4831 CASE_PRINT,
4832 CASE_PRINT,
4833 CASE_PRINT,
4834 /*	T		U		V		W	*/
4835 CASE_PRINT,
4836 CASE_PRINT,
4837 CASE_PRINT,
4838 CASE_PRINT,
4839 /*	X		Y		Z		[	*/
4840 CASE_PRINT,
4841 CASE_PRINT,
4842 CASE_PRINT,
4843 CASE_PRINT,
4844 /*	\		]		^		_	*/
4845 CASE_PRINT,
4846 CASE_PRINT,
4847 CASE_PRINT,
4848 CASE_PRINT,
4849 /*	`		a		b		c	*/
4850 CASE_PRINT,
4851 CASE_PRINT,
4852 CASE_PRINT,
4853 CASE_PRINT,
4854 /*	d		e		f		g	*/
4855 CASE_PRINT,
4856 CASE_PRINT,
4857 CASE_PRINT,
4858 CASE_PRINT,
4859 /*	h		i		j		k	*/
4860 CASE_PRINT,
4861 CASE_PRINT,
4862 CASE_PRINT,
4863 CASE_PRINT,
4864 /*	l		m		n		o	*/
4865 CASE_PRINT,
4866 CASE_PRINT,
4867 CASE_PRINT,
4868 CASE_PRINT,
4869 /*	p		q		r		s	*/
4870 CASE_PRINT,
4871 CASE_PRINT,
4872 CASE_PRINT,
4873 CASE_PRINT,
4874 /*	t		u		v		w	*/
4875 CASE_PRINT,
4876 CASE_PRINT,
4877 CASE_PRINT,
4878 CASE_PRINT,
4879 /*	x		y		z		{	*/
4880 CASE_PRINT,
4881 CASE_PRINT,
4882 CASE_PRINT,
4883 CASE_PRINT,
4884 /*	|		}		~		DEL	*/
4885 CASE_PRINT,
4886 CASE_PRINT,
4887 CASE_PRINT,
4888 CASE_PRINT,
4889 /*      0x80            0x81            0x82            0x83    */
4890 CASE_SJIS_INSTRING,
4891 CASE_SJIS_INSTRING,
4892 CASE_SJIS_INSTRING,
4893 CASE_SJIS_INSTRING,
4894 /*      0x84            0x85            0x86            0x87    */
4895 CASE_SJIS_INSTRING,
4896 CASE_SJIS_INSTRING,
4897 CASE_SJIS_INSTRING,
4898 CASE_SJIS_INSTRING,
4899 /*      0x88            0x89            0x8a            0x8b    */
4900 CASE_SJIS_INSTRING,
4901 CASE_SJIS_INSTRING,
4902 CASE_SJIS_INSTRING,
4903 CASE_SJIS_INSTRING,
4904 /*      0x8c            0x8d            0x8e            0x8f    */
4905 CASE_SJIS_INSTRING,
4906 CASE_SJIS_INSTRING,
4907 CASE_SJIS_INSTRING,
4908 CASE_SJIS_INSTRING,
4909 /*      0x90            0x91            0x92            0x93    */
4910 CASE_SJIS_INSTRING,
4911 CASE_SJIS_INSTRING,
4912 CASE_SJIS_INSTRING,
4913 CASE_SJIS_INSTRING,
4914 /*      0x94            0x95            0x96            0x97    */
4915 CASE_SJIS_INSTRING,
4916 CASE_SJIS_INSTRING,
4917 CASE_SJIS_INSTRING,
4918 CASE_SJIS_INSTRING,
4919 /*      0x99            0x99            0x9a            0x9b    */
4920 CASE_SJIS_INSTRING,
4921 CASE_SJIS_INSTRING,
4922 CASE_SJIS_INSTRING,
4923 CASE_SJIS_INSTRING,
4924 /*      0x9c            0x9d            0x9e            0x9f    */
4925 CASE_SJIS_INSTRING,
4926 CASE_SJIS_INSTRING,
4927 CASE_SJIS_INSTRING,
4928 CASE_SJIS_INSTRING,
4929 /*      0xa0		0xa1		0xa2		0xa3	*/
4930 CASE_SJIS_KANA,
4931 CASE_SJIS_KANA,
4932 CASE_SJIS_KANA,
4933 CASE_SJIS_KANA,
4934 /*      0xa4		0xa5		0xa6		0xa7	*/
4935 CASE_SJIS_KANA,
4936 CASE_SJIS_KANA,
4937 CASE_SJIS_KANA,
4938 CASE_SJIS_KANA,
4939 /*      0xa8		0xa9		0xaa		0xab	*/
4940 CASE_SJIS_KANA,
4941 CASE_SJIS_KANA,
4942 CASE_SJIS_KANA,
4943 CASE_SJIS_KANA,
4944 /*      0xac		0xad		0xae		0xaf	*/
4945 CASE_SJIS_KANA,
4946 CASE_SJIS_KANA,
4947 CASE_SJIS_KANA,
4948 CASE_SJIS_KANA,
4949 /*      0xb0		0xb1		0xb2		0xb3	*/
4950 CASE_SJIS_KANA,
4951 CASE_SJIS_KANA,
4952 CASE_SJIS_KANA,
4953 CASE_SJIS_KANA,
4954 /*      0xb4		0xb5		0xb6		0xb7	*/
4955 CASE_SJIS_KANA,
4956 CASE_SJIS_KANA,
4957 CASE_SJIS_KANA,
4958 CASE_SJIS_KANA,
4959 /*      0xb8		0xb9		0xba		0xbb	*/
4960 CASE_SJIS_KANA,
4961 CASE_SJIS_KANA,
4962 CASE_SJIS_KANA,
4963 CASE_SJIS_KANA,
4964 /*      0xbc		0xbd		0xbe		0xbf	*/
4965 CASE_SJIS_KANA,
4966 CASE_SJIS_KANA,
4967 CASE_SJIS_KANA,
4968 CASE_SJIS_KANA,
4969 /*      0xc0		0xc1		0xc2		0xc3	*/
4970 CASE_SJIS_KANA,
4971 CASE_SJIS_KANA,
4972 CASE_SJIS_KANA,
4973 CASE_SJIS_KANA,
4974 /*      0xc4		0xc5		0xc6		0xc7	*/
4975 CASE_SJIS_KANA,
4976 CASE_SJIS_KANA,
4977 CASE_SJIS_KANA,
4978 CASE_SJIS_KANA,
4979 /*      0xc8		0xc9		0xca		0xcb	*/
4980 CASE_SJIS_KANA,
4981 CASE_SJIS_KANA,
4982 CASE_SJIS_KANA,
4983 CASE_SJIS_KANA,
4984 /*      0xcc		0xcd		0xce		0xcf	*/
4985 CASE_SJIS_KANA,
4986 CASE_SJIS_KANA,
4987 CASE_SJIS_KANA,
4988 CASE_SJIS_KANA,
4989 /*      0xd0		0xd1		0xd2		0xd3	*/
4990 CASE_SJIS_KANA,
4991 CASE_SJIS_KANA,
4992 CASE_SJIS_KANA,
4993 CASE_SJIS_KANA,
4994 /*      0xd4		0xd5		0xd6		0xd7	*/
4995 CASE_SJIS_KANA,
4996 CASE_SJIS_KANA,
4997 CASE_SJIS_KANA,
4998 CASE_SJIS_KANA,
4999 /*      0xd8		0xd9		0xda		0xdb	*/
5000 CASE_SJIS_KANA,
5001 CASE_SJIS_KANA,
5002 CASE_SJIS_KANA,
5003 CASE_SJIS_KANA,
5004 /*      0xdc		0xdd		0xde		0xdf	*/
5005 CASE_SJIS_KANA,
5006 CASE_SJIS_KANA,
5007 CASE_SJIS_KANA,
5008 CASE_SJIS_KANA,
5009 /*      0xe0		0xe1		0xe2		0xe3	*/
5010 CASE_SJIS_INSTRING,
5011 CASE_SJIS_INSTRING,
5012 CASE_SJIS_INSTRING,
5013 CASE_SJIS_INSTRING,
5014 /*      0xe4		0xe5		0xe6		0xe7	*/
5015 CASE_SJIS_INSTRING,
5016 CASE_SJIS_INSTRING,
5017 CASE_SJIS_INSTRING,
5018 CASE_SJIS_INSTRING,
5019 /*      0xe8		0xe9		0xea		0xeb	*/
5020 CASE_SJIS_INSTRING,
5021 CASE_SJIS_INSTRING,
5022 CASE_SJIS_INSTRING,
5023 CASE_SJIS_INSTRING,
5024 /*      0xec		0xed		0xee		0xef	*/
5025 CASE_SJIS_INSTRING,
5026 CASE_SJIS_INSTRING,
5027 CASE_SJIS_INSTRING,
5028 CASE_SJIS_INSTRING,
5029 /*      0xf0		0xf1		0xf2		0xf3	*/
5030 CASE_SJIS_INSTRING,
5031 CASE_SJIS_INSTRING,
5032 CASE_SJIS_INSTRING,
5033 CASE_SJIS_INSTRING,
5034 /*      0xf4		0xf5		0xf6		0xf7	*/
5035 CASE_SJIS_INSTRING,
5036 CASE_SJIS_INSTRING,
5037 CASE_SJIS_INSTRING,
5038 CASE_SJIS_INSTRING,
5039 /*      0xf8		0xf9		0xfa		0xfb	*/
5040 CASE_SJIS_INSTRING,
5041 CASE_SJIS_INSTRING,
5042 CASE_SJIS_INSTRING,
5043 CASE_SJIS_INSTRING,
5044 /*      0xfc		0xfd		0xfe		0xff	*/
5045 CASE_SJIS_INSTRING,
5046 CASE_SJIS_INSTRING,
5047 CASE_SJIS_INSTRING,
5048 CASE_SJIS_INSTRING,
5049 };
5050 
5051 
5052 // #pragma mark Line drawing table
5053 int gLineDrawTable[] =
5054 {
5055 /*	NUL		SOH		STX		ETX	*/
5056 CASE_IGNORE,
5057 CASE_IGNORE,
5058 CASE_IGNORE,
5059 CASE_IGNORE,
5060 /*	EOT		ENQ		ACK		BEL	*/
5061 CASE_IGNORE,
5062 CASE_IGNORE,
5063 CASE_IGNORE,
5064 CASE_BELL,
5065 /*	BS		HT		NL		VT	*/
5066 CASE_BS,
5067 CASE_TAB,
5068 CASE_LF,
5069 CASE_LF, /* CASE_UP*/
5070 /*	NP		CR		SO		SI	*/
5071 CASE_LF, /* CASE_IGNORE*/
5072 CASE_CR,
5073 CASE_SO,
5074 CASE_SI,
5075 /*	DLE		DC1		DC2		DC3	*/
5076 CASE_IGNORE,
5077 CASE_IGNORE,
5078 CASE_IGNORE,
5079 CASE_IGNORE,
5080 /*	DC4		NAK		SYN		ETB	*/
5081 CASE_IGNORE,
5082 CASE_IGNORE,
5083 CASE_IGNORE,
5084 CASE_IGNORE,
5085 /*	CAN		EM		SUB		ESC	*/
5086 CASE_IGNORE,
5087 CASE_IGNORE,
5088 CASE_IGNORE,
5089 CASE_ESC,
5090 /*	FS		GS		RS		US	*/
5091 CASE_IGNORE,
5092 CASE_IGNORE,
5093 CASE_IGNORE,
5094 CASE_IGNORE,
5095 /*	SP		!		"		#	*/
5096 CASE_PRINT,
5097 CASE_PRINT,
5098 CASE_PRINT,
5099 CASE_PRINT,
5100 /*	$		%		&		'	*/
5101 CASE_PRINT,
5102 CASE_PRINT,
5103 CASE_PRINT,
5104 CASE_PRINT,
5105 /*	(		)		*		+	*/
5106 CASE_PRINT,
5107 CASE_PRINT,
5108 CASE_PRINT,
5109 CASE_PRINT,
5110 /*	,		-		.		/	*/
5111 CASE_PRINT,
5112 CASE_PRINT,
5113 CASE_PRINT,
5114 CASE_PRINT,
5115 /*	0		1		2		3	*/
5116 CASE_PRINT,
5117 CASE_PRINT,
5118 CASE_PRINT,
5119 CASE_PRINT,
5120 /*	4		5		6		7	*/
5121 CASE_PRINT,
5122 CASE_PRINT,
5123 CASE_PRINT,
5124 CASE_PRINT,
5125 /*	8		9		:		;	*/
5126 CASE_PRINT,
5127 CASE_PRINT,
5128 CASE_PRINT,
5129 CASE_PRINT,
5130 /*	<		=		>		?	*/
5131 CASE_PRINT,
5132 CASE_PRINT,
5133 CASE_PRINT,
5134 CASE_PRINT,
5135 /*	@		A		B		C	*/
5136 CASE_PRINT,
5137 CASE_PRINT,
5138 CASE_PRINT,
5139 CASE_PRINT,
5140 /*	D		E		F		G	*/
5141 CASE_PRINT,
5142 CASE_PRINT,
5143 CASE_PRINT,
5144 CASE_PRINT,
5145 /*	H		I		J		K	*/
5146 CASE_PRINT,
5147 CASE_PRINT,
5148 CASE_PRINT,
5149 CASE_PRINT,
5150 /*	L		M		N		O	*/
5151 CASE_PRINT,
5152 CASE_PRINT,
5153 CASE_PRINT,
5154 CASE_PRINT,
5155 /*	P		Q		R		S	*/
5156 CASE_PRINT,
5157 CASE_PRINT,
5158 CASE_PRINT,
5159 CASE_PRINT,
5160 /*	T		U		V		W	*/
5161 CASE_PRINT,
5162 CASE_PRINT,
5163 CASE_PRINT,
5164 CASE_PRINT,
5165 /*	X		Y		Z		[	*/
5166 CASE_PRINT,
5167 CASE_PRINT,
5168 CASE_PRINT,
5169 CASE_PRINT,
5170 /*	\		]		^		_	*/
5171 CASE_PRINT,
5172 CASE_PRINT,
5173 CASE_PRINT,
5174 CASE_PRINT,
5175 /*	`		a		b		c	*/
5176 CASE_PRINT,
5177 CASE_PRINT_GRA,
5178 CASE_PRINT,
5179 CASE_PRINT,
5180 /*	d		e		f		g	*/
5181 CASE_PRINT,
5182 CASE_PRINT,
5183 CASE_PRINT,
5184 CASE_PRINT,
5185 /*	h		i		j		k	*/
5186 CASE_PRINT,
5187 CASE_PRINT,
5188 CASE_PRINT_GRA,
5189 CASE_PRINT_GRA,
5190 /*	l		m		n		o	*/
5191 CASE_PRINT_GRA,
5192 CASE_PRINT_GRA,
5193 CASE_PRINT_GRA,
5194 CASE_PRINT,
5195 /*	p		q		r		s	*/
5196 CASE_PRINT,
5197 CASE_PRINT_GRA,
5198 CASE_PRINT,
5199 CASE_PRINT,
5200 /*	t		u		v		w	*/
5201 CASE_PRINT_GRA,
5202 CASE_PRINT_GRA,
5203 CASE_PRINT_GRA,
5204 CASE_PRINT_GRA,
5205 /*	x		y		z		{	*/
5206 CASE_PRINT_GRA,
5207 CASE_PRINT,
5208 CASE_PRINT,
5209 CASE_PRINT,
5210 /*	|		}		~		DEL	*/
5211 CASE_PRINT,
5212 CASE_PRINT,
5213 CASE_PRINT,
5214 CASE_IGNORE,
5215 /*      0x80            0x81            0x82            0x83    */
5216 CASE_UTF8_INSTRING,
5217 CASE_UTF8_INSTRING,
5218 CASE_UTF8_INSTRING,
5219 CASE_UTF8_INSTRING,
5220 /*      0x84            0x85            0x86            0x87    */
5221 CASE_UTF8_INSTRING,
5222 CASE_UTF8_INSTRING,
5223 CASE_UTF8_INSTRING,
5224 CASE_UTF8_INSTRING,
5225 /*      0x88            0x89            0x8a            0x8b    */
5226 CASE_UTF8_INSTRING,
5227 CASE_UTF8_INSTRING,
5228 CASE_UTF8_INSTRING,
5229 CASE_UTF8_INSTRING,
5230 /*      0x8c            0x8d            0x8e            0x8f    */
5231 CASE_UTF8_INSTRING,
5232 CASE_UTF8_INSTRING,
5233 CASE_UTF8_INSTRING,
5234 CASE_UTF8_INSTRING,
5235 /*      0x90            0x91            0x92            0x93    */
5236 CASE_UTF8_INSTRING,
5237 CASE_UTF8_INSTRING,
5238 CASE_UTF8_INSTRING,
5239 CASE_UTF8_INSTRING,
5240 /*      0x94            0x95            0x96            0x97    */
5241 CASE_UTF8_INSTRING,
5242 CASE_UTF8_INSTRING,
5243 CASE_UTF8_INSTRING,
5244 CASE_UTF8_INSTRING,
5245 /*      0x99            0x99            0x9a            0x9b    */
5246 CASE_UTF8_INSTRING,
5247 CASE_UTF8_INSTRING,
5248 CASE_UTF8_INSTRING,
5249 CASE_UTF8_INSTRING,
5250 /*      0x9c            0x9d            0x9e            0x9f    */
5251 CASE_UTF8_INSTRING,
5252 CASE_UTF8_INSTRING,
5253 CASE_UTF8_INSTRING,
5254 CASE_UTF8_INSTRING,
5255 /*      0xa0		0xa1		0xa2		0xa3	*/
5256 CASE_UTF8_INSTRING,
5257 CASE_UTF8_INSTRING,
5258 CASE_UTF8_INSTRING,
5259 CASE_UTF8_INSTRING,
5260 /*      0xa4		0xa5		0xa6		0xa7	*/
5261 CASE_UTF8_INSTRING,
5262 CASE_UTF8_INSTRING,
5263 CASE_UTF8_INSTRING,
5264 CASE_UTF8_INSTRING,
5265 /*      0xa8		0xa9		0xaa		0xab	*/
5266 CASE_UTF8_INSTRING,
5267 CASE_UTF8_INSTRING,
5268 CASE_UTF8_INSTRING,
5269 CASE_UTF8_INSTRING,
5270 /*      0xac		0xad		0xae		0xaf	*/
5271 CASE_UTF8_INSTRING,
5272 CASE_UTF8_INSTRING,
5273 CASE_UTF8_INSTRING,
5274 CASE_UTF8_INSTRING,
5275 /*      0xb0		0xb1		0xb2		0xb3	*/
5276 CASE_UTF8_INSTRING,
5277 CASE_UTF8_INSTRING,
5278 CASE_UTF8_INSTRING,
5279 CASE_UTF8_INSTRING,
5280 /*      0xb4		0xb5		0xb6		0xb7	*/
5281 CASE_UTF8_INSTRING,
5282 CASE_UTF8_INSTRING,
5283 CASE_UTF8_INSTRING,
5284 CASE_UTF8_INSTRING,
5285 /*      0xb8		0xb9		0xba		0xbb	*/
5286 CASE_UTF8_INSTRING,
5287 CASE_UTF8_INSTRING,
5288 CASE_UTF8_INSTRING,
5289 CASE_UTF8_INSTRING,
5290 /*      0xbc		0xbd		0xbe		0xbf	*/
5291 CASE_UTF8_INSTRING,
5292 CASE_UTF8_INSTRING,
5293 CASE_UTF8_INSTRING,
5294 CASE_UTF8_INSTRING,
5295 /*      0xc0		0xc1		0xc2		0xc3	*/
5296 CASE_UTF8_2BYTE,
5297 CASE_UTF8_2BYTE,
5298 CASE_UTF8_2BYTE,
5299 CASE_UTF8_2BYTE,
5300 /*      0xc4		0xc5		0xc6		0xc7	*/
5301 CASE_UTF8_2BYTE,
5302 CASE_UTF8_2BYTE,
5303 CASE_UTF8_2BYTE,
5304 CASE_UTF8_2BYTE,
5305 /*      0xc8		0xc9		0xca		0xcb	*/
5306 CASE_UTF8_2BYTE,
5307 CASE_UTF8_2BYTE,
5308 CASE_UTF8_2BYTE,
5309 CASE_UTF8_2BYTE,
5310 /*      0xcc		0xcd		0xce		0xcf	*/
5311 CASE_UTF8_2BYTE,
5312 CASE_UTF8_2BYTE,
5313 CASE_UTF8_2BYTE,
5314 CASE_UTF8_2BYTE,
5315 /*      0xd0		0xd1		0xd2		0xd3	*/
5316 CASE_UTF8_2BYTE,
5317 CASE_UTF8_2BYTE,
5318 CASE_UTF8_2BYTE,
5319 CASE_UTF8_2BYTE,
5320 /*      0xd4		0xd5		0xd6		0xd7	*/
5321 CASE_UTF8_2BYTE,
5322 CASE_UTF8_2BYTE,
5323 CASE_UTF8_2BYTE,
5324 CASE_UTF8_2BYTE,
5325 /*      0xd8		0xd9		0xda		0xdb	*/
5326 CASE_UTF8_2BYTE,
5327 CASE_UTF8_2BYTE,
5328 CASE_UTF8_2BYTE,
5329 CASE_UTF8_2BYTE,
5330 /*      0xdc		0xdd		0xde		0xdf	*/
5331 CASE_UTF8_2BYTE,
5332 CASE_UTF8_2BYTE,
5333 CASE_UTF8_2BYTE,
5334 CASE_UTF8_2BYTE,
5335 /*      0xe0		0xe1		0xe2		0xe3	*/
5336 CASE_UTF8_3BYTE,
5337 CASE_UTF8_3BYTE,
5338 CASE_UTF8_3BYTE,
5339 CASE_UTF8_3BYTE,
5340 /*      0xe4		0xe5		0xe6		0xe7	*/
5341 CASE_UTF8_3BYTE,
5342 CASE_UTF8_3BYTE,
5343 CASE_UTF8_3BYTE,
5344 CASE_UTF8_3BYTE,
5345 /*      0xe8		0xe9		0xea		0xeb	*/
5346 CASE_UTF8_3BYTE,
5347 CASE_UTF8_3BYTE,
5348 CASE_UTF8_3BYTE,
5349 CASE_UTF8_3BYTE,
5350 /*      0xec		0xed		0xee		0xef	*/
5351 CASE_UTF8_3BYTE,
5352 CASE_UTF8_3BYTE,
5353 CASE_UTF8_3BYTE,
5354 CASE_UTF8_3BYTE,
5355 /*      0xf0		0xf1		0xf2		0xf3	*/
5356 CASE_UTF8_3BYTE,
5357 CASE_UTF8_3BYTE,
5358 CASE_UTF8_3BYTE,
5359 CASE_UTF8_3BYTE,
5360 /*      0xf4		0xf5		0xf6		0xf7	*/
5361 CASE_UTF8_3BYTE,
5362 CASE_UTF8_3BYTE,
5363 CASE_UTF8_3BYTE,
5364 CASE_UTF8_3BYTE,
5365 /*      0xf8		0xf9		0xfa		0xfb	*/
5366 CASE_UTF8_3BYTE,
5367 CASE_UTF8_3BYTE,
5368 CASE_UTF8_3BYTE,
5369 CASE_UTF8_3BYTE,
5370 /*      0xfc		0xfd		0xfe		0xff	*/
5371 CASE_UTF8_3BYTE,
5372 CASE_UTF8_3BYTE,
5373 CASE_UTF8_3BYTE,
5374 CASE_UTF8_3BYTE,
5375 };
5376