xref: /titanic_41/usr/src/uts/common/sys/kiconv_ja.h (revision 15d9d0b528387242011cdcc6190c9e598cfe3a07)
1*15d9d0b5Syy154373 /*
2*15d9d0b5Syy154373  * CDDL HEADER START
3*15d9d0b5Syy154373  *
4*15d9d0b5Syy154373  * The contents of this file are subject to the terms of the
5*15d9d0b5Syy154373  * Common Development and Distribution License (the "License").
6*15d9d0b5Syy154373  * You may not use this file except in compliance with the License.
7*15d9d0b5Syy154373  *
8*15d9d0b5Syy154373  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*15d9d0b5Syy154373  * or http://www.opensolaris.org/os/licensing.
10*15d9d0b5Syy154373  * See the License for the specific language governing permissions
11*15d9d0b5Syy154373  * and limitations under the License.
12*15d9d0b5Syy154373  *
13*15d9d0b5Syy154373  * When distributing Covered Code, include this CDDL HEADER in each
14*15d9d0b5Syy154373  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*15d9d0b5Syy154373  * If applicable, add the following below this CDDL HEADER, with the
16*15d9d0b5Syy154373  * fields enclosed by brackets "[]" replaced with your own identifying
17*15d9d0b5Syy154373  * information: Portions Copyright [yyyy] [name of copyright owner]
18*15d9d0b5Syy154373  *
19*15d9d0b5Syy154373  * CDDL HEADER END
20*15d9d0b5Syy154373  */
21*15d9d0b5Syy154373 
22*15d9d0b5Syy154373 /*
23*15d9d0b5Syy154373  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*15d9d0b5Syy154373  * Use is subject to license terms.
25*15d9d0b5Syy154373  */
26*15d9d0b5Syy154373 
27*15d9d0b5Syy154373 #ifndef _SYS_KICONV_JA_H
28*15d9d0b5Syy154373 #define	_SYS_KICONV_JA_H
29*15d9d0b5Syy154373 
30*15d9d0b5Syy154373 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*15d9d0b5Syy154373 
32*15d9d0b5Syy154373 #ifdef __cplusplus
33*15d9d0b5Syy154373 extern "C" {
34*15d9d0b5Syy154373 #endif
35*15d9d0b5Syy154373 
36*15d9d0b5Syy154373 #include <sys/kiconv.h>
37*15d9d0b5Syy154373 
38*15d9d0b5Syy154373 /*
39*15d9d0b5Syy154373  * kiconv_ja specific definition
40*15d9d0b5Syy154373  */
41*15d9d0b5Syy154373 
42*15d9d0b5Syy154373 #define	KICONV_JA_TBLID_EUCJP		(0x00)
43*15d9d0b5Syy154373 #define	KICONV_JA_TBLID_EUCJP_MS	(0x01)
44*15d9d0b5Syy154373 #define	KICONV_JA_TBLID_SJIS		(0x02)
45*15d9d0b5Syy154373 #define	KICONV_JA_TBLID_CP932		(0x03)
46*15d9d0b5Syy154373 
47*15d9d0b5Syy154373 #define	KICONV_JA_MAX_MAPPING_TBLID	(0x03)
48*15d9d0b5Syy154373 
49*15d9d0b5Syy154373 #define	KICONV_JA_DEF_SINGLE	KICONV_ASCII_REPLACEMENT_CHAR
50*15d9d0b5Syy154373 #define	KICONV_JA_REPLACE	(0xfffd)
51*15d9d0b5Syy154373 #define	KICONV_JA_NODEST	(0xffff)
52*15d9d0b5Syy154373 #define	KICONV_JA_IFHISUR(x)	((0xd800 <= (x)) && ((x) <= 0xdbff))
53*15d9d0b5Syy154373 #define	KICONV_JA_IFLOSUR(x)	((0xdc00 <= (x)) && ((x) <= 0xdfff))
54*15d9d0b5Syy154373 
55*15d9d0b5Syy154373 #define	KICONV_JA_RETERROR(no) {\
56*15d9d0b5Syy154373 		*errno = (no);\
57*15d9d0b5Syy154373 		rv = ((size_t)-1);\
58*15d9d0b5Syy154373 		goto ret;\
59*15d9d0b5Syy154373 	}
60*15d9d0b5Syy154373 
61*15d9d0b5Syy154373 #define	KICONV_JA_NGET(c) \
62*15d9d0b5Syy154373 	if (ileft == 0) {\
63*15d9d0b5Syy154373 		KICONV_JA_RETERROR(EINVAL)\
64*15d9d0b5Syy154373 	} else {\
65*15d9d0b5Syy154373 		ileft--;\
66*15d9d0b5Syy154373 		(c) = *ip++;\
67*15d9d0b5Syy154373 	}
68*15d9d0b5Syy154373 
69*15d9d0b5Syy154373 #define	KICONV_JA_NGET_REP_FR_MB(c) \
70*15d9d0b5Syy154373 	if (ileft == 0) {\
71*15d9d0b5Syy154373 		KICONV_JA_PUTU(KICONV_JA_REPLACE)\
72*15d9d0b5Syy154373 		rv++;\
73*15d9d0b5Syy154373 		goto next;\
74*15d9d0b5Syy154373 	} else {\
75*15d9d0b5Syy154373 		ileft--;\
76*15d9d0b5Syy154373 		(c) = *ip++;\
77*15d9d0b5Syy154373 	}
78*15d9d0b5Syy154373 
79*15d9d0b5Syy154373 #define	KICONV_JA_NGET_REP_TO_MB(c) \
80*15d9d0b5Syy154373 	if (ileft == 0) {\
81*15d9d0b5Syy154373 		l = KICONV_JA_DEF_SINGLE;\
82*15d9d0b5Syy154373 		*repnum = 1;\
83*15d9d0b5Syy154373 		goto ret;\
84*15d9d0b5Syy154373 	} else {\
85*15d9d0b5Syy154373 		ileft--;\
86*15d9d0b5Syy154373 		(c) = *ip++;\
87*15d9d0b5Syy154373 	}
88*15d9d0b5Syy154373 
89*15d9d0b5Syy154373 #define	KICONV_JA_NPUT(c) \
90*15d9d0b5Syy154373 	if (oleft == 0) {\
91*15d9d0b5Syy154373 		KICONV_JA_RETERROR(E2BIG)\
92*15d9d0b5Syy154373 	} else {\
93*15d9d0b5Syy154373 		oleft--;\
94*15d9d0b5Syy154373 		*op++ = (uint8_t)(c);\
95*15d9d0b5Syy154373 	}
96*15d9d0b5Syy154373 
97*15d9d0b5Syy154373 #define	KICONV_JA_GETU(pu32, flag) \
98*15d9d0b5Syy154373 	read_len = read_unicode((pu32), &ip, &ileft, errno, (flag), &rv); \
99*15d9d0b5Syy154373 	switch (read_len) { \
100*15d9d0b5Syy154373 	case (size_t)-1: \
101*15d9d0b5Syy154373 		/* errno has been set in read_unicode() */ \
102*15d9d0b5Syy154373 		rv = (size_t)-1; \
103*15d9d0b5Syy154373 		goto ret; \
104*15d9d0b5Syy154373 	case (size_t)0: \
105*15d9d0b5Syy154373 		/* character read was handled in the read_unicode() */ \
106*15d9d0b5Syy154373 		/* no further evaluation needed in caller side */ \
107*15d9d0b5Syy154373 		goto next; \
108*15d9d0b5Syy154373 	default: \
109*15d9d0b5Syy154373 		break; \
110*15d9d0b5Syy154373 	}
111*15d9d0b5Syy154373 
112*15d9d0b5Syy154373 #define	KICONV_JA_PUTU(u32)	\
113*15d9d0b5Syy154373 	if (write_unicode((u32), &op, &oleft, errno) \
114*15d9d0b5Syy154373 			== (size_t)-1) { \
115*15d9d0b5Syy154373 		rv = ((size_t)-1);\
116*15d9d0b5Syy154373 		goto ret; \
117*15d9d0b5Syy154373 	}
118*15d9d0b5Syy154373 
119*15d9d0b5Syy154373 #define	KICONV_JA_CHECK_UTF8_BOM(inbuf, inleft) \
120*15d9d0b5Syy154373 	if (((kiconv_state_t)kcd)->bom_processed == 0 && (inleft) >= 3 && \
121*15d9d0b5Syy154373 		*(inbuf) == 0xef && \
122*15d9d0b5Syy154373 		*((inbuf) + 1) == 0xbb && \
123*15d9d0b5Syy154373 		*((inbuf) + 2) == 0xbf) { \
124*15d9d0b5Syy154373 		(inbuf) += 3; \
125*15d9d0b5Syy154373 		(inleft) -= 3; \
126*15d9d0b5Syy154373 	} \
127*15d9d0b5Syy154373 	((kiconv_state_t)kcd)->bom_processed = 1
128*15d9d0b5Syy154373 
129*15d9d0b5Syy154373 #define	KICONV_JA_CHECK_UTF8_BOM_WITHOUT_STATE(inbuf, inleft) \
130*15d9d0b5Syy154373 	if ((inleft) >= 3 && *(inbuf) == 0xef && \
131*15d9d0b5Syy154373 		*((inbuf) + 1) == 0xbb && \
132*15d9d0b5Syy154373 		*((inbuf) + 2) == 0xbf) { \
133*15d9d0b5Syy154373 		(inbuf) += 3; \
134*15d9d0b5Syy154373 		(inleft) -= 3; \
135*15d9d0b5Syy154373 	}
136*15d9d0b5Syy154373 
137*15d9d0b5Syy154373 #define	KICONV_JA_ERR_RETURN	(-1)		/* result code on error */
138*15d9d0b5Syy154373 
139*15d9d0b5Syy154373 /*
140*15d9d0b5Syy154373  * KICONV_JA_ISXXXX(c) macros below assume (c) is of type ushort_t
141*15d9d0b5Syy154373  */
142*15d9d0b5Syy154373 /* is a valid code as ascii? */
143*15d9d0b5Syy154373 #define	KICONV_JA_ISASC(c)		((c) <= 0x7f)
144*15d9d0b5Syy154373 
145*15d9d0b5Syy154373 /* is a valid code as C1 control? */
146*15d9d0b5Syy154373 #define	KICONV_JA_ISC1CTRL(c)		(((c) >= 0x80) && ((c) <= 0x9f))
147*15d9d0b5Syy154373 
148*15d9d0b5Syy154373 /* is a valid code as C1 control allowed in EUC? */
149*15d9d0b5Syy154373 #define	KICONV_JA_ISC1CTRLEUC(c)	((((c) >= 0x80) && ((c) <= 0x8d)) ||\
150*15d9d0b5Syy154373 					(((c) >= 0x90) && ((c) <= 0x9f)))
151*15d9d0b5Syy154373 
152*15d9d0b5Syy154373 /* is a valid 1st or 2nd byte of EUC codeset 1? */
153*15d9d0b5Syy154373 #define	KICONV_JA_ISCS1(c)		(((c) >= 0xa1) && ((c) <= 0xfe))
154*15d9d0b5Syy154373 
155*15d9d0b5Syy154373 /* is a valid 1st byte of EUC codeset 1 and in range row 1 thru 84? */
156*15d9d0b5Syy154373 #define	KICONV_JA_ISCS1_0208(c)		(((c) >= 0xa1) && ((c) <= 0xf4))
157*15d9d0b5Syy154373 
158*15d9d0b5Syy154373 /* is a valid 1st byte of UDC area in EUC codeset 1? */
159*15d9d0b5Syy154373 #define	KICONV_JA_ISCS1_UDC(c)		(((c) >= 0xf5) && ((c) <= 0xfe))
160*15d9d0b5Syy154373 
161*15d9d0b5Syy154373 /* is a valid 2nd (1st byte is SS2) byte of EUC codeset 2? */
162*15d9d0b5Syy154373 #define	KICONV_JA_ISCS2(c)		(((c) >= 0xa1) && ((c) <= 0xdf))
163*15d9d0b5Syy154373 
164*15d9d0b5Syy154373 /* is a valid 2nd or 3rd (1st byte is SS3) byte of EUC codeset 3? */
165*15d9d0b5Syy154373 #define	KICONV_JA_ISCS3(c)		(((c) >= 0xa1) && ((c) <= 0xfe))
166*15d9d0b5Syy154373 
167*15d9d0b5Syy154373 /* is a valid 2nd (1st byte is SS3) byte of UDC area in EUC codeset 3? */
168*15d9d0b5Syy154373 #define	KICONV_JA_ISCS3_UDC(c)		(((c) >= 0xf5) && ((c) <= 0xfe))
169*15d9d0b5Syy154373 
170*15d9d0b5Syy154373 /* is a valid hankaku_katakana for SJIS? */
171*15d9d0b5Syy154373 #define	KICONV_JA_ISSJKANA(c)		(((c) >= 0xa1) && ((c) <= 0xdf))
172*15d9d0b5Syy154373 
173*15d9d0b5Syy154373 /* is a valid character for the first byte of SJIS multibyte? */
174*15d9d0b5Syy154373 #define	KICONV_JA_ISSJMB_1(c) \
175*15d9d0b5Syy154373 	((((c) >= 0x81) && ((c) <= 0x9f)) || \
176*15d9d0b5Syy154373 	(((c) >= 0xe0) && ((c) <= 0xfc)))
177*15d9d0b5Syy154373 
178*15d9d0b5Syy154373 /* is a valid character for the first byte of SJIS kanji? */
179*15d9d0b5Syy154373 #define	KICONV_JA_ISSJKANJI1(c) \
180*15d9d0b5Syy154373 	((((c) >= 0x81) && ((c) <= 0x9f)) || \
181*15d9d0b5Syy154373 	(((c) >= 0xe0) && ((c) <= 0xea)) || \
182*15d9d0b5Syy154373 	(((c) >= 0xf0) && ((c) <= 0xf4)))
183*15d9d0b5Syy154373 
184*15d9d0b5Syy154373 /* is a valid character for the first byte of a part of Suppl. SJIS? */
185*15d9d0b5Syy154373 #define	KICONV_JA_ISSJSUPKANJI1(c)	(((c) >= 0xf5) && ((c) <= 0xf9))
186*15d9d0b5Syy154373 
187*15d9d0b5Syy154373 /* is a valid character for the first byte of SJIS UDC? */
188*15d9d0b5Syy154373 #define	KICONV_JA_ISSJUDC_1(c)		(((c) >= 0xf0) && ((c) <= 0xf9))
189*15d9d0b5Syy154373 
190*15d9d0b5Syy154373 /* is a valid character for the first byte of ibm character set */
191*15d9d0b5Syy154373 #define	KICONV_JA_ISSJIBM(c)		(((c) >= 0xfa) && ((c) <= 0xfc))
192*15d9d0b5Syy154373 
193*15d9d0b5Syy154373 /* is a valid character for the first byte of ibm character set */
194*15d9d0b5Syy154373 #define	KICONV_JA_ISSJNECIBM(c)		(((c) >= 0xed) && ((c) <= 0xef))
195*15d9d0b5Syy154373 
196*15d9d0b5Syy154373 /* is a valid character for the second byte of SJIS kanji? */
197*15d9d0b5Syy154373 #define	KICONV_JA_ISSJKANJI2(c)	\
198*15d9d0b5Syy154373 	((((c) >= 0x40) && ((c) <= 0x7e)) || \
199*15d9d0b5Syy154373 	(((c) >= 0x80) && ((c) <= 0xfc)))
200*15d9d0b5Syy154373 
201*15d9d0b5Syy154373 /* is a valid character for UTF8 UDC ? */
202*15d9d0b5Syy154373 #define	KICONV_JA_ISUTF8UDC(c)	(((c) >= 0xe000) && ((c) <= 0xf8ff))
203*15d9d0b5Syy154373 
204*15d9d0b5Syy154373 #define	KICONV_JA_CMASK				0x7f
205*15d9d0b5Syy154373 #define	KICONV_JA_CMSB				0x80
206*15d9d0b5Syy154373 
207*15d9d0b5Syy154373 /*
208*15d9d0b5Syy154373  * Remap NEC/IBM codes to IBM codes
209*15d9d0b5Syy154373  * if dest == 0xffff, that means the source
210*15d9d0b5Syy154373  * code point is illegal in the current spec.
211*15d9d0b5Syy154373  */
212*15d9d0b5Syy154373 #define	KICONV_JA_REMAP_NEC(dest) \
213*15d9d0b5Syy154373 	if ((0xed40 <= (dest)) && \
214*15d9d0b5Syy154373 		((dest) <= 0xed62)) { \
215*15d9d0b5Syy154373 		(dest) += 0xd1c; \
216*15d9d0b5Syy154373 	} else if ((0xed63 <= (dest)) && \
217*15d9d0b5Syy154373 		((dest) <= 0xed7e)) { \
218*15d9d0b5Syy154373 		(dest) += 0xd1d; \
219*15d9d0b5Syy154373 	} else if ((0xed80 <= (dest)) && \
220*15d9d0b5Syy154373 		((dest) <= 0xede0)) { \
221*15d9d0b5Syy154373 		(dest) += 0xd1c; \
222*15d9d0b5Syy154373 	} else if ((0xede1 <= (dest)) && \
223*15d9d0b5Syy154373 		((dest) <= 0xedfc)) { \
224*15d9d0b5Syy154373 		(dest) += 0xd5f; \
225*15d9d0b5Syy154373 	} else if ((0xee40 <= (dest)) && \
226*15d9d0b5Syy154373 		((dest) <= 0xee62)) { \
227*15d9d0b5Syy154373 		(dest) += 0xd1c; \
228*15d9d0b5Syy154373 	} else if ((0xee63 <= (dest)) && \
229*15d9d0b5Syy154373 		((dest) <= 0xee7e)) { \
230*15d9d0b5Syy154373 		(dest) += 0xd1d; \
231*15d9d0b5Syy154373 	} else if ((0xee80 <= (dest)) && \
232*15d9d0b5Syy154373 		((dest) <= 0xeee0)) { \
233*15d9d0b5Syy154373 		(dest) += 0xd1c; \
234*15d9d0b5Syy154373 	} else if ((0xeee1 <= (dest)) && \
235*15d9d0b5Syy154373 		((dest) <= 0xeeec)) { \
236*15d9d0b5Syy154373 		(dest) += 0xd5f; \
237*15d9d0b5Syy154373 	} else if ((0xeeef <= (dest)) && \
238*15d9d0b5Syy154373 		((dest) <= 0xeef8)) { \
239*15d9d0b5Syy154373 		(dest) += 0xb51; \
240*15d9d0b5Syy154373 	} else if ((0xeef9 <= (dest)) && \
241*15d9d0b5Syy154373 		((dest) <= 0xeefc)) { \
242*15d9d0b5Syy154373 		(dest) += 0xb5b; \
243*15d9d0b5Syy154373 	} else { \
244*15d9d0b5Syy154373 		(dest) = 0xffff; \
245*15d9d0b5Syy154373 	}
246*15d9d0b5Syy154373 
247*15d9d0b5Syy154373 typedef ushort_t kiconv_ja_euc16_t;
248*15d9d0b5Syy154373 typedef ushort_t kiconv_ja_ucs2_t;
249*15d9d0b5Syy154373 
250*15d9d0b5Syy154373 /*
251*15d9d0b5Syy154373  * The following 6 vectors show JIS and SJIS mapping table.
252*15d9d0b5Syy154373  */
253*15d9d0b5Syy154373 static const uchar_t kiconv_ja_sjtojis1[] = {
254*15d9d0b5Syy154373 	0xff, 0x21, 0x23, 0x25, 0x27, 0x29, 0x2b, 0x2d,
255*15d9d0b5Syy154373 	0x2f, 0x31, 0x33, 0x35, 0x37, 0x39, 0x3b, 0x3d,
256*15d9d0b5Syy154373 	0x3f, 0x41, 0x43, 0x45, 0x47, 0x49, 0x4b, 0x4d,
257*15d9d0b5Syy154373 	0x4f, 0x51, 0x53, 0x55, 0x57, 0x59, 0x5b, 0x5d,
258*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
259*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
260*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
261*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
262*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
263*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
264*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
265*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
266*15d9d0b5Syy154373 	0x5f, 0x61, 0x63, 0x65, 0x67, 0x69, 0x6b, 0x6d,
267*15d9d0b5Syy154373 	0x6f, 0x71, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff,
268*15d9d0b5Syy154373 	0x75, 0x77, 0x79, 0x7b, 0x7d, 0x75, 0x77, 0x79,
269*15d9d0b5Syy154373 	0x7b, 0x7d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
270*15d9d0b5Syy154373 };
271*15d9d0b5Syy154373 static const uchar_t kiconv_ja_sjtojis2[] = {
272*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
273*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
274*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
275*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
276*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
277*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
278*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
279*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
280*15d9d0b5Syy154373 	0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
281*15d9d0b5Syy154373 	0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
282*15d9d0b5Syy154373 	0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
283*15d9d0b5Syy154373 	0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
284*15d9d0b5Syy154373 	0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
285*15d9d0b5Syy154373 	0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
286*15d9d0b5Syy154373 	0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
287*15d9d0b5Syy154373 	0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0xff,
288*15d9d0b5Syy154373 	0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
289*15d9d0b5Syy154373 	0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
290*15d9d0b5Syy154373 	0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
291*15d9d0b5Syy154373 	0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x21,
292*15d9d0b5Syy154373 	0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
293*15d9d0b5Syy154373 	0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31,
294*15d9d0b5Syy154373 	0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
295*15d9d0b5Syy154373 	0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41,
296*15d9d0b5Syy154373 	0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
297*15d9d0b5Syy154373 	0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
298*15d9d0b5Syy154373 	0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
299*15d9d0b5Syy154373 	0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61,
300*15d9d0b5Syy154373 	0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
301*15d9d0b5Syy154373 	0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71,
302*15d9d0b5Syy154373 	0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
303*15d9d0b5Syy154373 	0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0xff, 0xff, 0xff,
304*15d9d0b5Syy154373 };
305*15d9d0b5Syy154373 static const uchar_t kiconv_ja_jis208tosj1[] = {
306*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
307*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
308*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
309*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
310*15d9d0b5Syy154373 	0xff, 0x81, 0x81, 0x82, 0x82, 0x83, 0x83, 0x84,
311*15d9d0b5Syy154373 	0x84, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x88,
312*15d9d0b5Syy154373 	0x88, 0x89, 0x89, 0x8a, 0x8a, 0x8b, 0x8b, 0x8c,
313*15d9d0b5Syy154373 	0x8c, 0x8d, 0x8d, 0x8e, 0x8e, 0x8f, 0x8f, 0x90,
314*15d9d0b5Syy154373 	0x90, 0x91, 0x91, 0x92, 0x92, 0x93, 0x93, 0x94,
315*15d9d0b5Syy154373 	0x94, 0x95, 0x95, 0x96, 0x96, 0x97, 0x97, 0x98,
316*15d9d0b5Syy154373 	0x98, 0x99, 0x99, 0x9a, 0x9a, 0x9b, 0x9b, 0x9c,
317*15d9d0b5Syy154373 	0x9c, 0x9d, 0x9d, 0x9e, 0x9e, 0x9f, 0x9f, 0xe0,
318*15d9d0b5Syy154373 	0xe0, 0xe1, 0xe1, 0xe2, 0xe2, 0xe3, 0xe3, 0xe4,
319*15d9d0b5Syy154373 	0xe4, 0xe5, 0xe5, 0xe6, 0xe6, 0xe7, 0xe7, 0xe8,
320*15d9d0b5Syy154373 	0xe8, 0xe9, 0xe9, 0xea, 0xea, 0xf0, 0xf0, 0xf1,
321*15d9d0b5Syy154373 	0xf1, 0xf2, 0xf2, 0xf3, 0xf3, 0xf4, 0xf4, 0xff,
322*15d9d0b5Syy154373 };
323*15d9d0b5Syy154373 static const uchar_t kiconv_ja_jis212tosj1[] = {
324*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
325*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
326*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
327*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
328*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
329*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
330*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
331*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
332*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
333*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
334*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
335*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
336*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
337*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
338*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xf5, 0xf6,
339*15d9d0b5Syy154373 	0xf6, 0xf7, 0xf7, 0xf8, 0xf8, 0xf9, 0xf9, 0xff,
340*15d9d0b5Syy154373 };
341*15d9d0b5Syy154373 static const uchar_t kiconv_ja_jistosj2[] = {
342*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
343*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
344*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
345*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
346*15d9d0b5Syy154373 	0xff, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
347*15d9d0b5Syy154373 	0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e,
348*15d9d0b5Syy154373 	0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,
349*15d9d0b5Syy154373 	0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e,
350*15d9d0b5Syy154373 	0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
351*15d9d0b5Syy154373 	0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e,
352*15d9d0b5Syy154373 	0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
353*15d9d0b5Syy154373 	0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e,
354*15d9d0b5Syy154373 	0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
355*15d9d0b5Syy154373 	0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
356*15d9d0b5Syy154373 	0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
357*15d9d0b5Syy154373 	0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0xff,
358*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
359*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
360*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
361*15d9d0b5Syy154373 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
362*15d9d0b5Syy154373 	0xff, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5,
363*15d9d0b5Syy154373 	0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad,
364*15d9d0b5Syy154373 	0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5,
365*15d9d0b5Syy154373 	0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd,
366*15d9d0b5Syy154373 	0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5,
367*15d9d0b5Syy154373 	0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
368*15d9d0b5Syy154373 	0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
369*15d9d0b5Syy154373 	0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
370*15d9d0b5Syy154373 	0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
371*15d9d0b5Syy154373 	0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
372*15d9d0b5Syy154373 	0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5,
373*15d9d0b5Syy154373 	0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xff,
374*15d9d0b5Syy154373 };
375*15d9d0b5Syy154373 static const ushort_t kiconv_ja_sjtoibmext[] = {
376*15d9d0b5Syy154373 	0xf3f3, 0xf3f4, 0xf3f5, 0xf3f6, 0xf3f7, 0xf3f8, 0xf3f9, 0xf3fa,
377*15d9d0b5Syy154373 	0xf3fb, 0xf3fc, 0xf3fd, 0xf3fe, 0xf4a1, 0xf4a2, 0xf4a3, 0xf4a4,
378*15d9d0b5Syy154373 	0xf4a5, 0xf4a6, 0xf4a7, 0xf4a8, 0xffff, 0xa2c3, 0xf4a9, 0xf4aa,
379*15d9d0b5Syy154373 	0xf4ab, 0xf4ac, 0xf4ad, 0xffff, 0xd4e3, 0xdcdf, 0xe4e9, 0xe3f8,
380*15d9d0b5Syy154373 	0xd9a1, 0xb1bb, 0xf4ae, 0xc2ad, 0xc3fc, 0xe4d0, 0xc2bf, 0xbcf4,
381*15d9d0b5Syy154373 	0xb0a9, 0xb0c8, 0xf4af, 0xb0d2, 0xb0d4, 0xb0e3, 0xb0ee, 0xb1a7,
382*15d9d0b5Syy154373 	0xb1a3, 0xb1ac, 0xb1a9, 0xb1be, 0xb1df, 0xb1d8, 0xb1c8, 0xb1d7,
383*15d9d0b5Syy154373 	0xb1e3, 0xb1f4, 0xb1e1, 0xb2a3, 0xf4b0, 0xb2bb, 0xb2e6, 0xffff,
384*15d9d0b5Syy154373 	0xb2ed, 0xb2f5, 0xb2fc, 0xf4b1, 0xb3b5, 0xb3d8, 0xb3db, 0xb3e5,
385*15d9d0b5Syy154373 	0xb3ee, 0xb3fb, 0xf4b2, 0xf4b3, 0xb4c0, 0xb4c7, 0xb4d0, 0xb4de,
386*15d9d0b5Syy154373 	0xf4b4, 0xb5aa, 0xf4b5, 0xb5af, 0xb5c4, 0xb5e8, 0xf4b6, 0xb7c2,
387*15d9d0b5Syy154373 	0xb7e4, 0xb7e8, 0xb7e7, 0xf4b7, 0xf4b8, 0xf4b9, 0xb8ce, 0xb8e1,
388*15d9d0b5Syy154373 	0xb8f5, 0xb8f7, 0xb8f8, 0xb8fc, 0xb9af, 0xb9b7, 0xbabe, 0xbadb,
389*15d9d0b5Syy154373 	0xcdaa, 0xbae1, 0xf4ba, 0xbaeb, 0xbbb3, 0xbbb8, 0xf4bb, 0xbbca,
390*15d9d0b5Syy154373 	0xf4bc, 0xf4bd, 0xbbd0, 0xbbde, 0xbbf4, 0xbbf5, 0xbbf9, 0xbce4,
391*15d9d0b5Syy154373 	0xbced, 0xbcfe, 0xf4be, 0xbdc2, 0xbde7, 0xf4bf, 0xbdf0, 0xbeb0,
392*15d9d0b5Syy154373 	0xbeac, 0xf4c0, 0xbeb3, 0xbebd, 0xbecd, 0xbec9, 0xbee4, 0xbfa8,
393*15d9d0b5Syy154373 	0xbfc9, 0xc0c4, 0xc0e4, 0xc0f4, 0xc1a6, 0xf4c1, 0xc1f5, 0xc1fc,
394*15d9d0b5Syy154373 	0xf4c2, 0xc1f8, 0xc2ab, 0xc2a1, 0xc2a5, 0xf4c3, 0xc2b8, 0xc2ba,
395*15d9d0b5Syy154373 	0xf4c4, 0xc2c4, 0xc2d2, 0xc2d7, 0xc2db, 0xc2de, 0xc2ed, 0xc2f0,
396*15d9d0b5Syy154373 	0xf4c5, 0xc3a1, 0xc3b5, 0xc3c9, 0xc3b9, 0xf4c6, 0xc3d8, 0xc3fe,
397*15d9d0b5Syy154373 	0xf4c7, 0xc4cc, 0xf4c8, 0xc4d9, 0xc4ea, 0xc4fd, 0xf4c9, 0xc5a7,
398*15d9d0b5Syy154373 	0xc5b5, 0xc5b6, 0xf4ca, 0xc5d5, 0xc6b8, 0xc6d7, 0xc6e0, 0xc6ea,
399*15d9d0b5Syy154373 	0xc6e3, 0xc7a1, 0xc7ab, 0xc7c7, 0xc7c3, 0xffff, 0xffff, 0xffff,
400*15d9d0b5Syy154373 	0xc7cb, 0xc7cf, 0xc7d9, 0xf4cb, 0xf4cc, 0xc7e6, 0xc7ee, 0xc7fc,
401*15d9d0b5Syy154373 	0xc7eb, 0xc7f0, 0xc8b1, 0xc8e5, 0xc8f8, 0xc9a6, 0xc9ab, 0xc9ad,
402*15d9d0b5Syy154373 	0xf4cd, 0xc9ca, 0xc9d3, 0xc9e9, 0xc9e3, 0xc9fc, 0xc9f4, 0xc9f5,
403*15d9d0b5Syy154373 	0xf4ce, 0xcab3, 0xcabd, 0xcaef, 0xcaf1, 0xcbae, 0xf4cf, 0xcbca,
404*15d9d0b5Syy154373 	0xcbe6, 0xcbea, 0xcbf0, 0xcbf4, 0xcbee, 0xcca5, 0xcbf9, 0xccab,
405*15d9d0b5Syy154373 	0xccae, 0xccad, 0xccb2, 0xccc2, 0xccd0, 0xccd9, 0xf4d0, 0xcdbb,
406*15d9d0b5Syy154373 	0xf4d1, 0xcebb, 0xf4d2, 0xceba, 0xcec3, 0xf4d3, 0xcef2, 0xb3dd,
407*15d9d0b5Syy154373 	0xcfd5, 0xcfe2, 0xcfe9, 0xcfed, 0xf4d4, 0xf4d5, 0xf4d6, 0xffff,
408*15d9d0b5Syy154373 	0xf4d7, 0xd0e5, 0xf4d8, 0xd0e9, 0xd1e8, 0xf4d9, 0xf4da, 0xd1ec,
409*15d9d0b5Syy154373 	0xd2bb, 0xf4db, 0xd3e1, 0xd3e8, 0xd4a7, 0xf4dc, 0xf4dd, 0xd4d4,
410*15d9d0b5Syy154373 	0xd4f2, 0xd5ae, 0xf4de, 0xd7de, 0xf4df, 0xd8a2, 0xd8b7, 0xd8c1,
411*15d9d0b5Syy154373 	0xd8d1, 0xd8f4, 0xd9c6, 0xd9c8, 0xd9d1, 0xf4e0, 0xf4e1, 0xf4e2,
412*15d9d0b5Syy154373 	0xf4e3, 0xf4e4, 0xdcd3, 0xddc8, 0xddd4, 0xddea, 0xddfa, 0xdea4,
413*15d9d0b5Syy154373 	0xdeb0, 0xf4e5, 0xdeb5, 0xdecb, 0xf4e6, 0xdfb9, 0xf4e7, 0xdfc3,
414*15d9d0b5Syy154373 	0xf4e8, 0xf4e9, 0xe0d9, 0xf4ea, 0xf4eb, 0xe1e2, 0xf4ec, 0xf4ed,
415*15d9d0b5Syy154373 	0xf4ee, 0xe2c7, 0xe3a8, 0xe3a6, 0xe3a9, 0xe3af, 0xe3b0, 0xe3aa,
416*15d9d0b5Syy154373 	0xe3ab, 0xe3bc, 0xe3c1, 0xe3bf, 0xe3d5, 0xe3d8, 0xe3d6, 0xe3df,
417*15d9d0b5Syy154373 	0xe3e3, 0xe3e1, 0xe3d4, 0xe3e9, 0xe4a6, 0xe3f1, 0xe3f2, 0xe4cb,
418*15d9d0b5Syy154373 	0xe4c1, 0xe4c3, 0xe4be, 0xf4ef, 0xe4c0, 0xe4c7, 0xe4bf, 0xe4e0,
419*15d9d0b5Syy154373 	0xe4de, 0xe4d1, 0xf4f0, 0xe4dc, 0xe4d2, 0xe4db, 0xe4d4, 0xe4fa,
420*15d9d0b5Syy154373 	0xe4ef, 0xe5b3, 0xe5bf, 0xe5c9, 0xe5d0, 0xe5e2, 0xe5ea, 0xe5eb,
421*15d9d0b5Syy154373 	0xf4f1, 0xf4f2, 0xf4f3, 0xe6e8, 0xe6ef, 0xe7ac, 0xf4f4, 0xe7ae,
422*15d9d0b5Syy154373 	0xf4f5, 0xe7b1, 0xf4f6, 0xe7b2, 0xe8b1, 0xe8b6, 0xf4f7, 0xf4f8,
423*15d9d0b5Syy154373 	0xe8dd, 0xf4f9, 0xf4fa, 0xe9d1, 0xf4fb, 0xffff, 0xffff, 0xffff,
424*15d9d0b5Syy154373 	0xe9ed, 0xeacd, 0xf4fc, 0xeadb, 0xeae6, 0xeaea, 0xeba5, 0xebfb,
425*15d9d0b5Syy154373 	0xebfa, 0xf4fd, 0xecd6, 0xf4fe, 0xffff, 0xffff, 0xffff, 0xffff,
426*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
427*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
428*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
429*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
430*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
431*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
432*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
433*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
434*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
435*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
436*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
437*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
438*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
439*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
440*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
441*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
442*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
443*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
444*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
445*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
446*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
447*15d9d0b5Syy154373 	0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
448*15d9d0b5Syy154373 };
449*15d9d0b5Syy154373 
450*15d9d0b5Syy154373 #ifdef __cplusplus
451*15d9d0b5Syy154373 }
452*15d9d0b5Syy154373 #endif
453*15d9d0b5Syy154373 
454*15d9d0b5Syy154373 #endif /* _SYS_KICONV_JA_H */
455