1 /*
2  * Copyright (c) 2003, Artem B. Bityuckiy, SoftMine Corporation.
3  * Rights transferred to Franklin Electronic Publishers.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  */
26 #include <stdio.h>
27 #include <iconv.h>
28 #include <errno.h>
29 #include <newlib.h>
30 #include "check.h"
31 
32 #if defined(_ICONV_FROM_ENCODING_UTF_8) || \
33     defined(_ICONV_FROM_ENCODING_EUC_JP) || \
34     defined(_ICONV_FROM_ENCODING_SHIFT_JIS) || \
35     defined(_ICONV_FROM_ENCODING_UCS_2_INTERNAL)
36 
37 #ifdef _ICONV_FROM_ENCODING_UTF_8
38 char utf8[] =
39 {
40     0xe8,0x89,0xb2,0xe3,0x80,0x85,0xe3,0x83,0x86,0xe3,
41     0x82,0xad,0xe3,0x82,0xb9,0xe3,0x83,0x88,0xe3,0x83,
42     0x95,0xe3,0x82,0xa1,0xe3,0x82,0xa4,0xe3,0x83,0xab,
43     0xe9,0x9b,0x86,0x20,0x56,0x65,0x72,0x33,0x2e,0x33,
44     0x20,0x28,0x43,0x29,0x48,0x41,0x54,0x0d,0x0a,0x0d,
45     0x0a,0xe3,0x81,0x93,0xe3,0x81,0xae,0xe3,0x82,0xa2,
46     0xe3,0x83,0xbc,0xe3,0x82,0xab,0xe3,0x82,0xa4,0xe3,
47     0x83,0x96,0xe3,0x81,0xae,0xe6,0x9c,0x80,0xe6,0x96,
48     0xb0,0xe7,0x89,0x88,0xe3,0x81,0xaf,0xe3,0x81,0x93,
49     0xe3,0x81,0x93,0xe3,0x81,0xab,0xe3,0x81,0x82,0xe3,
50     0x82,0x8a,0xe3,0x81,0xbe,0xe3,0x81,0x99,0xe3,0x80,
51     0x82,0x0d,0x0a,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,
52     0x77,0x77,0x77,0x30,0x32,0x2e,0x73,0x6f,0x2d,0x6e,
53     0x65,0x74,0x2e,0x6e,0x65,0x2e,0x6a,0x70,0x2f,0x25,
54     0x37,0x45,0x68,0x61,0x74,0x2f,0x66,0x69,0x6c,0x65,
55     0x73,0x2f,0x69,0x6e,0x64,0x65,0x78,0x2d,0x6a,0x2e,
56     0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a,0x63,0x72,
57     0x2c,0x20,0x63,0x72,0x6c,0x66,0x2c,0x20,0x6c,0x66,
58     0xe3,0x83,0x87,0xe3,0x82,0xa3,0xe3,0x83,0xac,0xe3,
59     0x82,0xaf,0xe3,0x83,0x88,0xe3,0x83,0xaa,0x28,0xe3,
60     0x83,0x95,0xe3,0x82,0xa9,0xe3,0x83,0xab,0xe3,0x83,
61     0x80,0x29,0xe3,0x81,0xae,0xe5,0x86,0x85,0xe5,0xae,
62     0xb9,0xe3,0x81,0xaf,0xe5,0x90,0x8c,0xe3,0x81,0x98,
63     0xe3,0x81,0xa7,0xe3,0x81,0x99,0xe3,0x81,0x8c,0xe3,
64     0x80,0x81,0xe8,0xa1,0x8c,0xe3,0x81,0xae,0xe5,0x8c,
65     0xba,0xe5,0x88,0x87,0xe3,0x82,0x8a,0xe3,0x81,0x8c,
66     0xe3,0x81,0x9d,0xe3,0x82,0x8c,0xe3,0x81,0x9e,0xe3,
67     0x82,0x8c,0x0d,0x0a,0x43,0x52,0x28,0x4d,0x61,0x63,
68     0xe9,0xa2,0xa8,0x29,0xe3,0x80,0x81,0x43,0x52,0x2b,
69     0x4c,0x46,0x28,0x44,0x4f,0x53,0xe9,0xa2,0xa8,0x29,
70     0xe3,0x80,0x81,0x4c,0x46,0x28,0x55,0x4e,0x49,0x58,
71     0xe9,0xa2,0xa8,0x29,0xe3,0x81,0xab,0xe3,0x81,0xaa,
72     0xe3,0x81,0xa3,0xe3,0x81,0xa6,0xe3,0x81,0x84,0xe3,
73     0x81,0xbe,0xe3,0x81,0x99,0xe3,0x80,0x82,0x0d,0x0a,
74     0x0d,0x0a,0x0d,0x0a,0x6a,0x74,0x65,0x78,0x74,0x2f,
75     0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x72,0x65,0x61,0x64,
76     0x6d,0x65,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
77     0x20,0xe8,0x8b,0xb1,0xe8,0xaa,0x9e,0x52,0x45,0x41,
78     0x44,0x4d,0x45,0x20,0x20,0x20,0x20,0x20,0x28,0x41,
79     0x53,0x43,0x49,0x49,0x29,0x0d,0x0a,0x20,0x20,0x72,
80     0x65,0x61,0x64,0x6d,0x65,0x2e,0x65,0x75,0x63,0x20,
81     0x2d,0x2d,0x2d,0x20,0xe3,0x81,0x93,0xe3,0x81,0xae,
82     0xe3,0x83,0x95,0xe3,0x82,0xa1,0xe3,0x82,0xa4,0xe3,
83     0x83,0xab,0x20,0x20,0x20,0x28,0x45,0x55,0x43,0x2d,
84     0x4a,0x50,0x29,0x0d,0x0a,0x20,0x20,0x72,0x65,0x61,
85     0x64,0x6d,0x65,0x2e,0x6a,0x69,0x73,0x20,0x2d,0x2d,
86     0x2d,0x20,0xe6,0x97,0xa5,0xe6,0x9c,0xac,0xe8,0xaa,
87     0x9e,0x52,0x45,0x41,0x44,0x4d,0x45,0x20,0x20,0x20,
88     0x28,0x4a,0x49,0x53,0x29,0x0d,0x0a,0x20,0x20,0x72,
89     0x65,0x61,0x64,0x6d,0x65,0x2e,0x73,0x6a,0x73,0x20,
90     0x2d,0x2d,0x2d,0x20,0xe6,0x97,0xa5,0xe6,0x9c,0xac,
91     0xe8,0xaa,0x9e,0x52,0x45,0x41,0x44,0x4d,0x45,0x20,
92     0x20,0x20,0x28,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,
93     0x49,0x53,0x29,0x0d,0x0a,0x0d,0x0a,0x6a,0x74,0x65,
94     0x78,0x74,0x2f,0x63,0x72,0x2f,0x0d,0x0a,0x6a,0x74,
95     0x65,0x78,0x74,0x2f,0x63,0x72,0x6c,0x66,0x2f,0x0d,
96     0x0a,0x6a,0x74,0x65,0x78,0x74,0x2f,0x6c,0x66,0x2f,
97     0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x61,0x73,0x63,0x69,
98     0x69,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,
99     0x20,0x41,0x53,0x43,0x49,0x49,0xe3,0x81,0xa7,0xe6,
100     0x9b,0xb8,0xe3,0x81,0x84,0xe3,0x81,0x9f,0xe6,0x97,
101     0xa5,0xe6,0x9c,0xac,0xe8,0xaa,0x9e,0x28,0xe3,0x83,
102     0xad,0xe3,0x83,0xbc,0xe3,0x83,0x9e,0xe5,0xad,0x97,
103     0x29,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x6a,0x30,0x32,
104     0x30,0x31,0x2d,0x38,0x62,0x2e,0x74,0x78,0x74,0x20,
105     0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,
106     0x31,0xe3,0x81,0xae,0xe7,0x89,0x87,0xe4,0xbb,0xae,
107     0xe5,0x90,0x8d,0x20,0xe3,0x82,0x92,0x20,0x38,0xe5,
108     0x8d,0x98,0xe4,0xbd,0x8d,0xe7,0xac,0xa6,0xe5,0x8f,
109     0xb7,0xe5,0x8c,0x96,0x20,0x20,0x20,0x20,0x20,0x20,
110     0x20,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,0x53,
111     0xe3,0x81,0xa8,0xe5,0x90,0x8c,0xe3,0x81,0x98,0x0d,
112     0x0a,0x20,0x20,0x6a,0x30,0x32,0x30,0x31,0x2d,0x65,
113     0x73,0x2e,0x74,0x78,0x74,0x20,0x2d,0x20,0x4a,0x49,
114     0x53,0x20,0x58,0x30,0x32,0x30,0x31,0xe3,0x81,0xae,
115     0xe7,0x89,0x87,0xe4,0xbb,0xae,0xe5,0x90,0x8d,0x20,
116     0xe3,0x82,0x92,0x20,0x45,0x53,0x43,0x28,0x49,0xe3,
117     0x81,0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,0xe5,0x8c,
118     0x96,0x0d,0x0a,0x20,0x20,0x6a,0x30,0x32,0x30,0x31,
119     0x2d,0x73,0x6f,0x2e,0x74,0x78,0x74,0x20,0x2d,0x20,
120     0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,0x31,0xe3,
121     0x81,0xae,0xe7,0x89,0x87,0xe4,0xbb,0xae,0xe5,0x90,
122     0x8d,0x20,0xe3,0x82,0x92,0x20,0x53,0x4f,0x2f,0x53,
123     0x49,0xe3,0x81,0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,
124     0xe5,0x8c,0x96,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x6a,
125     0x30,0x32,0x30,0x38,0x2d,0x38,0x62,0x2e,0x74,0x78,
126     0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,
127     0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
128     0x20,0x20,0xe3,0x82,0x92,0x20,0x38,0xe5,0x8d,0x98,
129     0xe4,0xbd,0x8d,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,0xe5,
130     0x8c,0x96,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x45,
131     0x55,0x43,0x2d,0x4a,0x50,0xe3,0x81,0xa8,0xe5,0x90,
132     0x8c,0xe3,0x81,0x98,0x0d,0x0a,0x20,0x20,0x6a,0x30,
133     0x32,0x30,0x38,0x2d,0x37,0x38,0x2e,0x74,0x78,0x74,
134     0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,
135     0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
136     0x20,0xe3,0x82,0x92,0x20,0x45,0x53,0x43,0x24,0x40,
137     0xe3,0x81,0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,0xe5,
138     0x8c,0x96,0x20,0x20,0x20,0x20,0x20,0xe3,0x81,0x84,
139     0xe3,0x82,0x8f,0xe3,0x82,0x86,0xe3,0x82,0x8b,0xe6,
140     0x97,0xa7,0x4a,0x49,0x53,0x0d,0x0a,0x20,0x20,0x6a,
141     0x30,0x32,0x30,0x38,0x2d,0x38,0x33,0x2e,0x74,0x78,
142     0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,
143     0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
144     0x20,0x20,0xe3,0x82,0x92,0x20,0x45,0x53,0x43,0x24,
145     0x42,0xe3,0x81,0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,
146     0xe5,0x8c,0x96,0x20,0x20,0x20,0x20,0x20,0xe3,0x81,
147     0x84,0xe3,0x82,0x8f,0xe3,0x82,0x86,0xe3,0x82,0x8b,
148     0xe6,0x96,0xb0,0x4a,0x49,0x53,0x0d,0x0a,0x0d,0x0a,
149     0x20,0x20,0x65,0x30,0x32,0x30,0x31,0x2e,0x74,0x78,
150     0x74,0x20,0x2d,0x2d,0x2d,0x2d,0x20,0x4a,0x49,0x53,
151     0x20,0x58,0x30,0x32,0x30,0x31,0xe3,0x81,0xae,0xe7,
152     0x89,0x87,0xe4,0xbb,0xae,0xe5,0x90,0x8d,0x20,0xe3,
153     0x82,0x92,0x20,0x45,0x55,0x43,0x2d,0x4a,0x50,0xe3,
154     0x81,0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,0xe5,0x8c,
155     0x96,0x0d,0x0a,0x20,0x20,0x65,0x30,0x32,0x30,0x38,
156     0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,0x20,
157     0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,0x38,0x20,
158     0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe3,0x82,
159     0x92,0x20,0x45,0x55,0x43,0x2d,0x4a,0x50,0xe3,0x81,
160     0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,0xe5,0x8c,0x96,
161     0x20,0x20,0x20,0x20,0x38,0xe3,0x83,0x93,0xe3,0x83,
162     0x83,0xe3,0x83,0x88,0x4a,0x49,0x53,0x58,0x30,0x32,
163     0x30,0x38,0xe3,0x81,0xa8,0xe5,0x90,0x8c,0xe3,0x81,
164     0x98,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x73,0x30,0x32,
165     0x30,0x31,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
166     0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,
167     0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
168     0xe3,0x82,0x92,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,
169     0x4a,0x49,0x53,0xe3,0x81,0xa7,0xe7,0xac,0xa6,0xe5,
170     0x8f,0xb7,0xe5,0x8c,0x96,0x20,0x38,0xe3,0x83,0x93,
171     0xe3,0x83,0x83,0xe3,0x83,0x88,0x4a,0x49,0x53,0x58,
172     0x30,0x32,0x30,0x31,0xe3,0x81,0xa8,0xe5,0x90,0x8c,
173     0xe3,0x81,0x98,0x0d,0x0a,0x20,0x20,0x73,0x30,0x32,
174     0x30,0x38,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
175     0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,
176     0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
177     0xe3,0x82,0x92,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,
178     0x4a,0x49,0x53,0xe3,0x81,0xa7,0xe7,0xac,0xa6,0xe5,
179     0x8f,0xb7,0xe5,0x8c,0x96,0x0d,0x0a,0x0d,0x0a,0x6a,
180     0x74,0x65,0x78,0x74,0x2f,0x6f,0x74,0x68,0x65,0x72,
181     0x73,0x2f,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x62,0x36,
182     0x34,0x6a,0x69,0x73,0x2e,0x74,0x78,0x74,0x20,0x2d,
183     0x2d,0x2d,0x20,0x49,0x53,0x4f,0x2d,0x32,0x30,0x32,
184     0x32,0x2d,0x4a,0x50,0x20,0x28,0x4a,0x49,0x53,0x29,
185     0x20,0xe3,0x82,0x92,0x20,0x62,0x61,0x73,0x65,0x36,
186     0x34,0xe3,0x81,0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,
187     0xe5,0x8c,0x96,0x0d,0x0a,0x20,0x20,0x71,0x74,0x6a,
188     0x69,0x73,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
189     0x2d,0x20,0x49,0x53,0x4f,0x2d,0x32,0x30,0x32,0x32,
190     0x2d,0x4a,0x50,0x20,0x28,0x4a,0x49,0x53,0x29,0x20,
191     0xe3,0x82,0x92,0x20,0x71,0x75,0x6f,0x74,0x65,0x64,
192     0x2d,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,
193     0xe3,0x81,0xa7,0xe7,0xac,0xa6,0xe5,0x8f,0xb7,0xe5,
194     0x8c,0x96,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x62,0x6b,
195     0x65,0x75,0x63,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,
196     0x2d,0x2d,0x20,0xe5,0xa3,0x8a,0xe3,0x82,0x8c,0xe3,
197     0x81,0x9f,0x45,0x55,0x43,0x2d,0x4a,0x50,0x20,0x20,
198     0x20,0x20,0x20,0x20,0xe5,0x85,0x88,0xe9,0xa0,0xad,
199     0xe3,0x83,0x93,0xe3,0x83,0x83,0xe3,0x83,0x88,0xe3,
200     0x81,0x8c,0xe3,0x82,0xbc,0xe3,0x83,0xad,0x0d,0x0a,
201     0x20,0x20,0x62,0x6b,0x6a,0x69,0x73,0x2e,0x74,0x78,
202     0x74,0x20,0x2d,0x2d,0x2d,0x2d,0x20,0xe5,0xa3,0x8a,
203     0xe3,0x82,0x8c,0xe3,0x81,0x9f,0x4a,0x49,0x53,0x20,
204     0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x45,0x53,
205     0x43,0xe3,0x82,0xb3,0xe3,0x83,0xbc,0xe3,0x83,0x89,
206     0xe3,0x81,0x8c,0xe6,0xac,0xa0,0xe3,0x81,0x91,0xe3,
207     0x81,0x9f,0x0d,0x0a,0x20,0x20,0x62,0x6b,0x73,0x6a,
208     0x69,0x73,0x2e,0x74,0x78,0x74,0x2d,0x2d,0x2d,0x2d,
209     0x20,0xe5,0xa3,0x8a,0xe3,0x82,0x8c,0xe3,0x81,0x9f,
210     0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,0x53,0x20,
211     0x20,0x20,0xe5,0x85,0x88,0xe9,0xa0,0xad,0xe3,0x83,
212     0x93,0xe3,0x83,0x83,0xe3,0x83,0x88,0xe3,0x81,0x8c,
213     0xe3,0x82,0xbc,0xe3,0x83,0xad,0x0d,0x0a,0x0d,0x0a,
214     0x20,0x20,0x63,0x74,0x72,0x6c,0x5f,0x7a,0x2e,0x74,
215     0x78,0x74,0x20,0x20,0x20,0x20,0x20,0x53,0x68,0x69,
216     0x66,0x74,0x5f,0x4a,0x49,0x53,0x20,0x20,0x20,0x20,
217     0x20,0x20,0x5e,0x5a,0xe3,0x82,0xad,0xe3,0x83,0xa3,
218     0xe3,0x83,0xa9,0xe3,0x82,0xaf,0xe3,0x82,0xbf,0xe4,
219     0xbb,0x98,0xe3,0x81,0x8d,0x20,0x20,0x20,0x28,0x44,
220     0x4f,0x53,0xe9,0xa2,0xa8,0x29,0x0d,0x0a,0x20,0x20,
221     0x6d,0x61,0x63,0x74,0x78,0x74,0x2e,0x62,0x69,0x6e,
222     0x20,0x20,0x20,0x20,0x20,0xe3,0x83,0x9e,0xe3,0x83,
223     0x83,0xe3,0x82,0xaf,0xe3,0x83,0x90,0xe3,0x82,0xa4,
224     0xe3,0x83,0x8a,0xe3,0x83,0xaa,0x49,0x49,0xe3,0x83,
225     0x95,0xe3,0x82,0xa9,0xe3,0x83,0xbc,0xe3,0x83,0x9e,
226     0xe3,0x83,0x83,0xe3,0x83,0x88,0x0d,0xa
227  };
228 #endif /* ifdef _ICONV_FROM_ENCODING_UTF_8 */
229 
230 #ifdef _ICONV_FROM_ENCODING_EUC_JP
231  char euc_jp[] =
232  {
233     0xbf,0xa7,0xa1,0xb9,0xa5,0xc6,0xa5,0xad,0xa5,0xb9,
234     0xa5,0xc8,0xa5,0xd5,0xa5,0xa1,0xa5,0xa4,0xa5,0xeb,
235     0xbd,0xb8,0x20,0x56,0x65,0x72,0x33,0x2e,0x33,0x20,
236     0x28,0x43,0x29,0x48,0x41,0x54,0x0d,0x0a,0x0d,0x0a,
237     0xa4,0xb3,0xa4,0xce,0xa5,0xa2,0xa1,0xbc,0xa5,0xab,
238     0xa5,0xa4,0xa5,0xd6,0xa4,0xce,0xba,0xc7,0xbf,0xb7,
239     0xc8,0xc7,0xa4,0xcf,0xa4,0xb3,0xa4,0xb3,0xa4,0xcb,
240     0xa4,0xa2,0xa4,0xea,0xa4,0xde,0xa4,0xb9,0xa1,0xa3,
241     0x0d,0x0a,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,
242     0x77,0x77,0x30,0x32,0x2e,0x73,0x6f,0x2d,0x6e,0x65,
243     0x74,0x2e,0x6e,0x65,0x2e,0x6a,0x70,0x2f,0x25,0x37,
244     0x45,0x68,0x61,0x74,0x2f,0x66,0x69,0x6c,0x65,0x73,
245     0x2f,0x69,0x6e,0x64,0x65,0x78,0x2d,0x6a,0x2e,0x68,
246     0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a,0x63,0x72,0x2c,
247     0x20,0x63,0x72,0x6c,0x66,0x2c,0x20,0x6c,0x66,0xa5,
248     0xc7,0xa5,0xa3,0xa5,0xec,0xa5,0xaf,0xa5,0xc8,0xa5,
249     0xea,0x28,0xa5,0xd5,0xa5,0xa9,0xa5,0xeb,0xa5,0xc0,
250     0x29,0xa4,0xce,0xc6,0xe2,0xcd,0xc6,0xa4,0xcf,0xc6,
251     0xb1,0xa4,0xb8,0xa4,0xc7,0xa4,0xb9,0xa4,0xac,0xa1,
252     0xa2,0xb9,0xd4,0xa4,0xce,0xb6,0xe8,0xc0,0xda,0xa4,
253     0xea,0xa4,0xac,0xa4,0xbd,0xa4,0xec,0xa4,0xbe,0xa4,
254     0xec,0x0d,0x0a,0x43,0x52,0x28,0x4d,0x61,0x63,0xc9,
255     0xf7,0x29,0xa1,0xa2,0x43,0x52,0x2b,0x4c,0x46,0x28,
256     0x44,0x4f,0x53,0xc9,0xf7,0x29,0xa1,0xa2,0x4c,0x46,
257     0x28,0x55,0x4e,0x49,0x58,0xc9,0xf7,0x29,0xa4,0xcb,
258     0xa4,0xca,0xa4,0xc3,0xa4,0xc6,0xa4,0xa4,0xa4,0xde,
259     0xa4,0xb9,0xa1,0xa3,0x0d,0x0a,0x0d,0x0a,0x0d,0x0a,
260     0x6a,0x74,0x65,0x78,0x74,0x2f,0x0d,0x0a,0x0d,0x0a,
261     0x20,0x20,0x72,0x65,0x61,0x64,0x6d,0x65,0x2e,0x74,
262     0x78,0x74,0x20,0x2d,0x2d,0x2d,0x20,0xb1,0xd1,0xb8,
263     0xec,0x52,0x45,0x41,0x44,0x4d,0x45,0x20,0x20,0x20,
264     0x20,0x20,0x28,0x41,0x53,0x43,0x49,0x49,0x29,0x0d,
265     0x0a,0x20,0x20,0x72,0x65,0x61,0x64,0x6d,0x65,0x2e,
266     0x65,0x75,0x63,0x20,0x2d,0x2d,0x2d,0x20,0xa4,0xb3,
267     0xa4,0xce,0xa5,0xd5,0xa5,0xa1,0xa5,0xa4,0xa5,0xeb,
268     0x20,0x20,0x20,0x28,0x45,0x55,0x43,0x2d,0x4a,0x50,
269     0x29,0x0d,0x0a,0x20,0x20,0x72,0x65,0x61,0x64,0x6d,
270     0x65,0x2e,0x6a,0x69,0x73,0x20,0x2d,0x2d,0x2d,0x20,
271     0xc6,0xfc,0xcb,0xdc,0xb8,0xec,0x52,0x45,0x41,0x44,
272     0x4d,0x45,0x20,0x20,0x20,0x28,0x4a,0x49,0x53,0x29,
273     0x0d,0x0a,0x20,0x20,0x72,0x65,0x61,0x64,0x6d,0x65,
274     0x2e,0x73,0x6a,0x73,0x20,0x2d,0x2d,0x2d,0x20,0xc6,
275     0xfc,0xcb,0xdc,0xb8,0xec,0x52,0x45,0x41,0x44,0x4d,
276     0x45,0x20,0x20,0x20,0x28,0x53,0x68,0x69,0x66,0x74,
277     0x5f,0x4a,0x49,0x53,0x29,0x0d,0x0a,0x0d,0x0a,0x6a,
278     0x74,0x65,0x78,0x74,0x2f,0x63,0x72,0x2f,0x0d,0x0a,
279     0x6a,0x74,0x65,0x78,0x74,0x2f,0x63,0x72,0x6c,0x66,
280     0x2f,0x0d,0x0a,0x6a,0x74,0x65,0x78,0x74,0x2f,0x6c,
281     0x66,0x2f,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x61,0x73,
282     0x63,0x69,0x69,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,
283     0x2d,0x2d,0x20,0x41,0x53,0x43,0x49,0x49,0xa4,0xc7,
284     0xbd,0xf1,0xa4,0xa4,0xa4,0xbf,0xc6,0xfc,0xcb,0xdc,
285     0xb8,0xec,0x28,0xa5,0xed,0xa1,0xbc,0xa5,0xde,0xbb,
286     0xfa,0x29,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x6a,0x30,
287     0x32,0x30,0x31,0x2d,0x38,0x62,0x2e,0x74,0x78,0x74,
288     0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,
289     0x30,0x31,0xa4,0xce,0xca,0xd2,0xb2,0xbe,0xcc,0xbe,
290     0x20,0xa4,0xf2,0x20,0x38,0xc3,0xb1,0xb0,0xcc,0xc9,
291     0xe4,0xb9,0xe6,0xb2,0xbd,0x20,0x20,0x20,0x20,0x20,
292     0x20,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,
293     0x53,0xa4,0xc8,0xc6,0xb1,0xa4,0xb8,0x0d,0x0a,0x20,
294     0x20,0x6a,0x30,0x32,0x30,0x31,0x2d,0x65,0x73,0x2e,
295     0x74,0x78,0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,
296     0x58,0x30,0x32,0x30,0x31,0xa4,0xce,0xca,0xd2,0xb2,
297     0xbe,0xcc,0xbe,0x20,0xa4,0xf2,0x20,0x45,0x53,0x43,
298     0x28,0x49,0xa4,0xc7,0xc9,0xe4,0xb9,0xe6,0xb2,0xbd,
299     0x0d,0x0a,0x20,0x20,0x6a,0x30,0x32,0x30,0x31,0x2d,
300     0x73,0x6f,0x2e,0x74,0x78,0x74,0x20,0x2d,0x20,0x4a,
301     0x49,0x53,0x20,0x58,0x30,0x32,0x30,0x31,0xa4,0xce,
302     0xca,0xd2,0xb2,0xbe,0xcc,0xbe,0x20,0xa4,0xf2,0x20,
303     0x53,0x4f,0x2f,0x53,0x49,0xa4,0xc7,0xc9,0xe4,0xb9,
304     0xe6,0xb2,0xbd,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x6a,
305     0x30,0x32,0x30,0x38,0x2d,0x38,0x62,0x2e,0x74,0x78,
306     0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,
307     0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
308     0x20,0x20,0xa4,0xf2,0x20,0x38,0xc3,0xb1,0xb0,0xcc,
309     0xc9,0xe4,0xb9,0xe6,0xb2,0xbd,0x20,0x20,0x20,0x20,
310     0x20,0x20,0x20,0x45,0x55,0x43,0x2d,0x4a,0x50,0xa4,
311     0xc8,0xc6,0xb1,0xa4,0xb8,0x0d,0x0a,0x20,0x20,0x6a,
312     0x30,0x32,0x30,0x38,0x2d,0x37,0x38,0x2e,0x74,0x78,
313     0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,
314     0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
315     0x20,0x20,0xa4,0xf2,0x20,0x45,0x53,0x43,0x24,0x40,
316     0xa4,0xc7,0xc9,0xe4,0xb9,0xe6,0xb2,0xbd,0x20,0x20,
317     0x20,0x20,0x20,0xa4,0xa4,0xa4,0xef,0xa4,0xe6,0xa4,
318     0xeb,0xb5,0xec,0x4a,0x49,0x53,0x0d,0x0a,0x20,0x20,
319     0x6a,0x30,0x32,0x30,0x38,0x2d,0x38,0x33,0x2e,0x74,
320     0x78,0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,
321     0x30,0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,
322     0x20,0x20,0x20,0xa4,0xf2,0x20,0x45,0x53,0x43,0x24,
323     0x42,0xa4,0xc7,0xc9,0xe4,0xb9,0xe6,0xb2,0xbd,0x20,
324     0x20,0x20,0x20,0x20,0xa4,0xa4,0xa4,0xef,0xa4,0xe6,
325     0xa4,0xeb,0xbf,0xb7,0x4a,0x49,0x53,0x0d,0x0a,0x0d,
326     0x0a,0x20,0x20,0x65,0x30,0x32,0x30,0x31,0x2e,0x74,
327     0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,0x20,0x4a,0x49,
328     0x53,0x20,0x58,0x30,0x32,0x30,0x31,0xa4,0xce,0xca,
329     0xd2,0xb2,0xbe,0xcc,0xbe,0x20,0xa4,0xf2,0x20,0x45,
330     0x55,0x43,0x2d,0x4a,0x50,0xa4,0xc7,0xc9,0xe4,0xb9,
331     0xe6,0xb2,0xbd,0x0d,0x0a,0x20,0x20,0x65,0x30,0x32,
332     0x30,0x38,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
333     0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,
334     0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
335     0xa4,0xf2,0x20,0x45,0x55,0x43,0x2d,0x4a,0x50,0xa4,
336     0xc7,0xc9,0xe4,0xb9,0xe6,0xb2,0xbd,0x20,0x20,0x20,
337     0x20,0x38,0xa5,0xd3,0xa5,0xc3,0xa5,0xc8,0x4a,0x49,
338     0x53,0x58,0x30,0x32,0x30,0x38,0xa4,0xc8,0xc6,0xb1,
339     0xa4,0xb8,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x73,0x30,
340     0x32,0x30,0x31,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,
341     0x2d,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,
342     0x30,0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
343     0x20,0xa4,0xf2,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,
344     0x4a,0x49,0x53,0xa4,0xc7,0xc9,0xe4,0xb9,0xe6,0xb2,
345     0xbd,0x20,0x38,0xa5,0xd3,0xa5,0xc3,0xa5,0xc8,0x4a,
346     0x49,0x53,0x58,0x30,0x32,0x30,0x31,0xa4,0xc8,0xc6,
347     0xb1,0xa4,0xb8,0x0d,0x0a,0x20,0x20,0x73,0x30,0x32,
348     0x30,0x38,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
349     0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,
350     0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
351     0xa4,0xf2,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,
352     0x49,0x53,0xa4,0xc7,0xc9,0xe4,0xb9,0xe6,0xb2,0xbd,
353     0x0d,0x0a,0x0d,0x0a,0x6a,0x74,0x65,0x78,0x74,0x2f,
354     0x6f,0x74,0x68,0x65,0x72,0x73,0x2f,0x0d,0x0a,0x0d,
355     0x0a,0x20,0x20,0x62,0x36,0x34,0x6a,0x69,0x73,0x2e,
356     0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,0x20,0x49,0x53,
357     0x4f,0x2d,0x32,0x30,0x32,0x32,0x2d,0x4a,0x50,0x20,
358     0x28,0x4a,0x49,0x53,0x29,0x20,0xa4,0xf2,0x20,0x62,
359     0x61,0x73,0x65,0x36,0x34,0xa4,0xc7,0xc9,0xe4,0xb9,
360     0xe6,0xb2,0xbd,0x0d,0x0a,0x20,0x20,0x71,0x74,0x6a,
361     0x69,0x73,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
362     0x2d,0x20,0x49,0x53,0x4f,0x2d,0x32,0x30,0x32,0x32,
363     0x2d,0x4a,0x50,0x20,0x28,0x4a,0x49,0x53,0x29,0x20,
364     0xa4,0xf2,0x20,0x71,0x75,0x6f,0x74,0x65,0x64,0x2d,
365     0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0xa4,
366     0xc7,0xc9,0xe4,0xb9,0xe6,0xb2,0xbd,0x0d,0x0a,0x0d,
367     0x0a,0x20,0x20,0x62,0x6b,0x65,0x75,0x63,0x2e,0x74,
368     0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,0x20,0xb2,0xf5,
369     0xa4,0xec,0xa4,0xbf,0x45,0x55,0x43,0x2d,0x4a,0x50,
370     0x20,0x20,0x20,0x20,0x20,0x20,0xc0,0xe8,0xc6,0xac,
371     0xa5,0xd3,0xa5,0xc3,0xa5,0xc8,0xa4,0xac,0xa5,0xbc,
372     0xa5,0xed,0x0d,0x0a,0x20,0x20,0x62,0x6b,0x6a,0x69,
373     0x73,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,
374     0x20,0xb2,0xf5,0xa4,0xec,0xa4,0xbf,0x4a,0x49,0x53,
375     0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x45,
376     0x53,0x43,0xa5,0xb3,0xa1,0xbc,0xa5,0xc9,0xa4,0xac,
377     0xb7,0xe7,0xa4,0xb1,0xa4,0xbf,0x0d,0x0a,0x20,0x20,
378     0x62,0x6b,0x73,0x6a,0x69,0x73,0x2e,0x74,0x78,0x74,
379     0x2d,0x2d,0x2d,0x2d,0x20,0xb2,0xf5,0xa4,0xec,0xa4,
380     0xbf,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,0x53,
381     0x20,0x20,0x20,0xc0,0xe8,0xc6,0xac,0xa5,0xd3,0xa5,
382     0xc3,0xa5,0xc8,0xa4,0xac,0xa5,0xbc,0xa5,0xed,0x0d,
383     0x0a,0x0d,0x0a,0x20,0x20,0x63,0x74,0x72,0x6c,0x5f,
384     0x7a,0x2e,0x74,0x78,0x74,0x20,0x20,0x20,0x20,0x20,
385     0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,0x53,0x20,
386     0x20,0x20,0x20,0x20,0x20,0x5e,0x5a,0xa5,0xad,0xa5,
387     0xe3,0xa5,0xe9,0xa5,0xaf,0xa5,0xbf,0xc9,0xd5,0xa4,
388     0xad,0x20,0x20,0x20,0x28,0x44,0x4f,0x53,0xc9,0xf7,
389     0x29,0x0d,0x0a,0x20,0x20,0x6d,0x61,0x63,0x74,0x78,
390     0x74,0x2e,0x62,0x69,0x6e,0x20,0x20,0x20,0x20,0x20,
391     0xa5,0xde,0xa5,0xc3,0xa5,0xaf,0xa5,0xd0,0xa5,0xa4,
392     0xa5,0xca,0xa5,0xea,0x49,0x49,0xa5,0xd5,0xa5,0xa9,
393     0xa1,0xbc,0xa5,0xde,0xa5,0xc3,0xa5,0xc8,0x0d,0x0a
394 };
395 #endif /* #ifdef _ICONV_FROM_ENCODING_EUC_JP */
396 
397 #ifdef _ICONV_FROM_ENCODING_SHIFT_JIS
398 char shift_jis[] =
399 {
400     0x90,0x46,0x81,0x58,0x83,0x65,0x83,0x4c,0x83,0x58,
401     0x83,0x67,0x83,0x74,0x83,0x40,0x83,0x43,0x83,0x8b,
402     0x8f,0x57,0x20,0x56,0x65,0x72,0x33,0x2e,0x33,0x20,
403     0x28,0x43,0x29,0x48,0x41,0x54,0x0d,0x0a,0x0d,0x0a,
404     0x82,0xb1,0x82,0xcc,0x83,0x41,0x81,0x5b,0x83,0x4a,
405     0x83,0x43,0x83,0x75,0x82,0xcc,0x8d,0xc5,0x90,0x56,
406     0x94,0xc5,0x82,0xcd,0x82,0xb1,0x82,0xb1,0x82,0xc9,
407     0x82,0xa0,0x82,0xe8,0x82,0xdc,0x82,0xb7,0x81,0x42,
408     0x0d,0x0a,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,
409     0x77,0x77,0x30,0x32,0x2e,0x73,0x6f,0x2d,0x6e,0x65,
410     0x74,0x2e,0x6e,0x65,0x2e,0x6a,0x70,0x2f,0x25,0x37,
411     0x45,0x68,0x61,0x74,0x2f,0x66,0x69,0x6c,0x65,0x73,
412     0x2f,0x69,0x6e,0x64,0x65,0x78,0x2d,0x6a,0x2e,0x68,
413     0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a,0x63,0x72,0x2c,
414     0x20,0x63,0x72,0x6c,0x66,0x2c,0x20,0x6c,0x66,0x83,
415     0x66,0x83,0x42,0x83,0x8c,0x83,0x4e,0x83,0x67,0x83,
416     0x8a,0x28,0x83,0x74,0x83,0x48,0x83,0x8b,0x83,0x5f,
417     0x29,0x82,0xcc,0x93,0xe0,0x97,0x65,0x82,0xcd,0x93,
418     0xaf,0x82,0xb6,0x82,0xc5,0x82,0xb7,0x82,0xaa,0x81,
419     0x41,0x8d,0x73,0x82,0xcc,0x8b,0xe6,0x90,0xd8,0x82,
420     0xe8,0x82,0xaa,0x82,0xbb,0x82,0xea,0x82,0xbc,0x82,
421     0xea,0x0d,0x0a,0x43,0x52,0x28,0x4d,0x61,0x63,0x95,
422     0x97,0x29,0x81,0x41,0x43,0x52,0x2b,0x4c,0x46,0x28,
423     0x44,0x4f,0x53,0x95,0x97,0x29,0x81,0x41,0x4c,0x46,
424     0x28,0x55,0x4e,0x49,0x58,0x95,0x97,0x29,0x82,0xc9,
425     0x82,0xc8,0x82,0xc1,0x82,0xc4,0x82,0xa2,0x82,0xdc,
426     0x82,0xb7,0x81,0x42,0x0d,0x0a,0x0d,0x0a,0x0d,0x0a,
427     0x6a,0x74,0x65,0x78,0x74,0x2f,0x0d,0x0a,0x0d,0x0a,
428     0x20,0x20,0x72,0x65,0x61,0x64,0x6d,0x65,0x2e,0x74,
429     0x78,0x74,0x20,0x2d,0x2d,0x2d,0x20,0x89,0x70,0x8c,
430     0xea,0x52,0x45,0x41,0x44,0x4d,0x45,0x20,0x20,0x20,
431     0x20,0x20,0x28,0x41,0x53,0x43,0x49,0x49,0x29,0x0d,
432     0x0a,0x20,0x20,0x72,0x65,0x61,0x64,0x6d,0x65,0x2e,
433     0x65,0x75,0x63,0x20,0x2d,0x2d,0x2d,0x20,0x82,0xb1,
434     0x82,0xcc,0x83,0x74,0x83,0x40,0x83,0x43,0x83,0x8b,
435     0x20,0x20,0x20,0x28,0x45,0x55,0x43,0x2d,0x4a,0x50,
436     0x29,0x0d,0x0a,0x20,0x20,0x72,0x65,0x61,0x64,0x6d,
437     0x65,0x2e,0x6a,0x69,0x73,0x20,0x2d,0x2d,0x2d,0x20,
438     0x93,0xfa,0x96,0x7b,0x8c,0xea,0x52,0x45,0x41,0x44,
439     0x4d,0x45,0x20,0x20,0x20,0x28,0x4a,0x49,0x53,0x29,
440     0x0d,0x0a,0x20,0x20,0x72,0x65,0x61,0x64,0x6d,0x65,
441     0x2e,0x73,0x6a,0x73,0x20,0x2d,0x2d,0x2d,0x20,0x93,
442     0xfa,0x96,0x7b,0x8c,0xea,0x52,0x45,0x41,0x44,0x4d,
443     0x45,0x20,0x20,0x20,0x28,0x53,0x68,0x69,0x66,0x74,
444     0x5f,0x4a,0x49,0x53,0x29,0x0d,0x0a,0x0d,0x0a,0x6a,
445     0x74,0x65,0x78,0x74,0x2f,0x63,0x72,0x2f,0x0d,0x0a,
446     0x6a,0x74,0x65,0x78,0x74,0x2f,0x63,0x72,0x6c,0x66,
447     0x2f,0x0d,0x0a,0x6a,0x74,0x65,0x78,0x74,0x2f,0x6c,
448     0x66,0x2f,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x61,0x73,
449     0x63,0x69,0x69,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,
450     0x2d,0x2d,0x20,0x41,0x53,0x43,0x49,0x49,0x82,0xc5,
451     0x8f,0x91,0x82,0xa2,0x82,0xbd,0x93,0xfa,0x96,0x7b,
452     0x8c,0xea,0x28,0x83,0x8d,0x81,0x5b,0x83,0x7d,0x8e,
453     0x9a,0x29,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x6a,0x30,
454     0x32,0x30,0x31,0x2d,0x38,0x62,0x2e,0x74,0x78,0x74,
455     0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,
456     0x30,0x31,0x82,0xcc,0x95,0xd0,0x89,0xbc,0x96,0xbc,
457     0x20,0x82,0xf0,0x20,0x38,0x92,0x50,0x88,0xca,0x95,
458     0x84,0x8d,0x86,0x89,0xbb,0x20,0x20,0x20,0x20,0x20,
459     0x20,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,
460     0x53,0x82,0xc6,0x93,0xaf,0x82,0xb6,0x0d,0x0a,0x20,
461     0x20,0x6a,0x30,0x32,0x30,0x31,0x2d,0x65,0x73,0x2e,
462     0x74,0x78,0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,
463     0x58,0x30,0x32,0x30,0x31,0x82,0xcc,0x95,0xd0,0x89,
464     0xbc,0x96,0xbc,0x20,0x82,0xf0,0x20,0x45,0x53,0x43,
465     0x28,0x49,0x82,0xc5,0x95,0x84,0x8d,0x86,0x89,0xbb,
466     0x0d,0x0a,0x20,0x20,0x6a,0x30,0x32,0x30,0x31,0x2d,
467     0x73,0x6f,0x2e,0x74,0x78,0x74,0x20,0x2d,0x20,0x4a,
468     0x49,0x53,0x20,0x58,0x30,0x32,0x30,0x31,0x82,0xcc,
469     0x95,0xd0,0x89,0xbc,0x96,0xbc,0x20,0x82,0xf0,0x20,
470     0x53,0x4f,0x2f,0x53,0x49,0x82,0xc5,0x95,0x84,0x8d,
471     0x86,0x89,0xbb,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x6a,
472     0x30,0x32,0x30,0x38,0x2d,0x38,0x62,0x2e,0x74,0x78,
473     0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,
474     0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
475     0x20,0x20,0x82,0xf0,0x20,0x38,0x92,0x50,0x88,0xca,
476     0x95,0x84,0x8d,0x86,0x89,0xbb,0x20,0x20,0x20,0x20,
477     0x20,0x20,0x20,0x45,0x55,0x43,0x2d,0x4a,0x50,0x82,
478     0xc6,0x93,0xaf,0x82,0xb6,0x0d,0x0a,0x20,0x20,0x6a,
479     0x30,0x32,0x30,0x38,0x2d,0x37,0x38,0x2e,0x74,0x78,
480     0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,
481     0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
482     0x20,0x20,0x82,0xf0,0x20,0x45,0x53,0x43,0x24,0x40,
483     0x82,0xc5,0x95,0x84,0x8d,0x86,0x89,0xbb,0x20,0x20,
484     0x20,0x20,0x20,0x82,0xa2,0x82,0xed,0x82,0xe4,0x82,
485     0xe9,0x8b,0x8c,0x4a,0x49,0x53,0x0d,0x0a,0x20,0x20,
486     0x6a,0x30,0x32,0x30,0x38,0x2d,0x38,0x33,0x2e,0x74,
487     0x78,0x74,0x20,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,
488     0x30,0x32,0x30,0x38,0x20,0x20,0x20,0x20,0x20,0x20,
489     0x20,0x20,0x20,0x82,0xf0,0x20,0x45,0x53,0x43,0x24,
490     0x42,0x82,0xc5,0x95,0x84,0x8d,0x86,0x89,0xbb,0x20,
491     0x20,0x20,0x20,0x20,0x82,0xa2,0x82,0xed,0x82,0xe4,
492     0x82,0xe9,0x90,0x56,0x4a,0x49,0x53,0x0d,0x0a,0x0d,
493     0x0a,0x20,0x20,0x65,0x30,0x32,0x30,0x31,0x2e,0x74,
494     0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,0x20,0x4a,0x49,
495     0x53,0x20,0x58,0x30,0x32,0x30,0x31,0x82,0xcc,0x95,
496     0xd0,0x89,0xbc,0x96,0xbc,0x20,0x82,0xf0,0x20,0x45,
497     0x55,0x43,0x2d,0x4a,0x50,0x82,0xc5,0x95,0x84,0x8d,
498     0x86,0x89,0xbb,0x0d,0x0a,0x20,0x20,0x65,0x30,0x32,
499     0x30,0x38,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
500     0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,
501     0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
502     0x82,0xf0,0x20,0x45,0x55,0x43,0x2d,0x4a,0x50,0x82,
503     0xc5,0x95,0x84,0x8d,0x86,0x89,0xbb,0x20,0x20,0x20,
504     0x20,0x38,0x83,0x72,0x83,0x62,0x83,0x67,0x4a,0x49,
505     0x53,0x58,0x30,0x32,0x30,0x38,0x82,0xc6,0x93,0xaf,
506     0x82,0xb6,0x0d,0x0a,0x0d,0x0a,0x20,0x20,0x73,0x30,
507     0x32,0x30,0x31,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,
508     0x2d,0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,
509     0x30,0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
510     0x20,0x82,0xf0,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,
511     0x4a,0x49,0x53,0x82,0xc5,0x95,0x84,0x8d,0x86,0x89,
512     0xbb,0x20,0x38,0x83,0x72,0x83,0x62,0x83,0x67,0x4a,
513     0x49,0x53,0x58,0x30,0x32,0x30,0x31,0x82,0xc6,0x93,
514     0xaf,0x82,0xb6,0x0d,0x0a,0x20,0x20,0x73,0x30,0x32,
515     0x30,0x38,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
516     0x2d,0x20,0x4a,0x49,0x53,0x20,0x58,0x30,0x32,0x30,
517     0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
518     0x82,0xf0,0x20,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,
519     0x49,0x53,0x82,0xc5,0x95,0x84,0x8d,0x86,0x89,0xbb,
520     0x0d,0x0a,0x0d,0x0a,0x6a,0x74,0x65,0x78,0x74,0x2f,
521     0x6f,0x74,0x68,0x65,0x72,0x73,0x2f,0x0d,0x0a,0x0d,
522     0x0a,0x20,0x20,0x62,0x36,0x34,0x6a,0x69,0x73,0x2e,
523     0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,0x20,0x49,0x53,
524     0x4f,0x2d,0x32,0x30,0x32,0x32,0x2d,0x4a,0x50,0x20,
525     0x28,0x4a,0x49,0x53,0x29,0x20,0x82,0xf0,0x20,0x62,
526     0x61,0x73,0x65,0x36,0x34,0x82,0xc5,0x95,0x84,0x8d,
527     0x86,0x89,0xbb,0x0d,0x0a,0x20,0x20,0x71,0x74,0x6a,
528     0x69,0x73,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,
529     0x2d,0x20,0x49,0x53,0x4f,0x2d,0x32,0x30,0x32,0x32,
530     0x2d,0x4a,0x50,0x20,0x28,0x4a,0x49,0x53,0x29,0x20,
531     0x82,0xf0,0x20,0x71,0x75,0x6f,0x74,0x65,0x64,0x2d,
532     0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x82,
533     0xc5,0x95,0x84,0x8d,0x86,0x89,0xbb,0x0d,0x0a,0x0d,
534     0x0a,0x20,0x20,0x62,0x6b,0x65,0x75,0x63,0x2e,0x74,
535     0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,0x20,0x89,0xf3,
536     0x82,0xea,0x82,0xbd,0x45,0x55,0x43,0x2d,0x4a,0x50,
537     0x20,0x20,0x20,0x20,0x20,0x20,0x90,0xe6,0x93,0xaa,
538     0x83,0x72,0x83,0x62,0x83,0x67,0x82,0xaa,0x83,0x5b,
539     0x83,0x8d,0x0d,0x0a,0x20,0x20,0x62,0x6b,0x6a,0x69,
540     0x73,0x2e,0x74,0x78,0x74,0x20,0x2d,0x2d,0x2d,0x2d,
541     0x20,0x89,0xf3,0x82,0xea,0x82,0xbd,0x4a,0x49,0x53,
542     0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x45,
543     0x53,0x43,0x83,0x52,0x81,0x5b,0x83,0x68,0x82,0xaa,
544     0x8c,0x87,0x82,0xaf,0x82,0xbd,0x0d,0x0a,0x20,0x20,
545     0x62,0x6b,0x73,0x6a,0x69,0x73,0x2e,0x74,0x78,0x74,
546     0x2d,0x2d,0x2d,0x2d,0x20,0x89,0xf3,0x82,0xea,0x82,
547     0xbd,0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,0x53,
548     0x20,0x20,0x20,0x90,0xe6,0x93,0xaa,0x83,0x72,0x83,
549     0x62,0x83,0x67,0x82,0xaa,0x83,0x5b,0x83,0x8d,0x0d,
550     0x0a,0x0d,0x0a,0x20,0x20,0x63,0x74,0x72,0x6c,0x5f,
551     0x7a,0x2e,0x74,0x78,0x74,0x20,0x20,0x20,0x20,0x20,
552     0x53,0x68,0x69,0x66,0x74,0x5f,0x4a,0x49,0x53,0x20,
553     0x20,0x20,0x20,0x20,0x20,0x5e,0x5a,0x83,0x4c,0x83,
554     0x83,0x83,0x89,0x83,0x4e,0x83,0x5e,0x95,0x74,0x82,
555     0xab,0x20,0x20,0x20,0x28,0x44,0x4f,0x53,0x95,0x97,
556     0x29,0x0d,0x0a,0x20,0x20,0x6d,0x61,0x63,0x74,0x78,
557     0x74,0x2e,0x62,0x69,0x6e,0x20,0x20,0x20,0x20,0x20,
558     0x83,0x7d,0x83,0x62,0x83,0x4e,0x83,0x6f,0x83,0x43,
559     0x83,0x69,0x83,0x8a,0x49,0x49,0x83,0x74,0x83,0x48,
560     0x81,0x5b,0x83,0x7d,0x83,0x62,0x83,0x67,0x0d,0x0a
561 };
562 #endif /* _ICONV_FROM_ENCODING_SHIFT_JIS */
563 
564 #ifdef _ICONV_FROM_ENCODING_UCS_2_INTERNAL
565 short ucs2[] =
566 {
567     0x8272,0x3005,0x30c6,0x30ad,0x30b9,
568     0x30c8,0x30d5,0x30a1,0x30a4,0x30eb,
569     0x96c6,0x0020,0x0056,0x0065,0x0072,
570     0x0033,0x002e,0x0033,0x0020,0x0028,
571     0x0043,0x0029,0x0048,0x0041,0x0054,
572     0x000d,0x000a,0x000d,0x000a,0x3053,
573     0x306e,0x30a2,0x30fc,0x30ab,0x30a4,
574     0x30d6,0x306e,0x6700,0x65b0,0x7248,
575     0x306f,0x3053,0x3053,0x306b,0x3042,
576     0x308a,0x307e,0x3059,0x3002,0x000d,
577     0x000a,0x0068,0x0074,0x0074,0x0070,
578     0x003a,0x002f,0x002f,0x0077,0x0077,
579     0x0077,0x0030,0x0032,0x002e,0x0073,
580     0x006f,0x002d,0x006e,0x0065,0x0074,
581     0x002e,0x006e,0x0065,0x002e,0x006a,
582     0x0070,0x002f,0x0025,0x0037,0x0045,
583     0x0068,0x0061,0x0074,0x002f,0x0066,
584     0x0069,0x006c,0x0065,0x0073,0x002f,
585     0x0069,0x006e,0x0064,0x0065,0x0078,
586     0x002d,0x006a,0x002e,0x0068,0x0074,
587     0x006d,0x006c,0x000d,0x000a,0x000d,
588     0x000a,0x0063,0x0072,0x002c,0x0020,
589     0x0063,0x0072,0x006c,0x0066,0x002c,
590     0x0020,0x006c,0x0066,0x30c7,0x30a3,
591     0x30ec,0x30af,0x30c8,0x30ea,0x0028,
592     0x30d5,0x30a9,0x30eb,0x30c0,0x0029,
593     0x306e,0x5185,0x5bb9,0x306f,0x540c,
594     0x3058,0x3067,0x3059,0x304c,0x3001,
595     0x884c,0x306e,0x533a,0x5207,0x308a,
596     0x304c,0x305d,0x308c,0x305e,0x308c,
597     0x000d,0x000a,0x0043,0x0052,0x0028,
598     0x004d,0x0061,0x0063,0x98a8,0x0029,
599     0x3001,0x0043,0x0052,0x002b,0x004c,
600     0x0046,0x0028,0x0044,0x004f,0x0053,
601     0x98a8,0x0029,0x3001,0x004c,0x0046,
602     0x0028,0x0055,0x004e,0x0049,0x0058,
603     0x98a8,0x0029,0x306b,0x306a,0x3063,
604     0x3066,0x3044,0x307e,0x3059,0x3002,
605     0x000d,0x000a,0x000d,0x000a,0x000d,
606     0x000a,0x006a,0x0074,0x0065,0x0078,
607     0x0074,0x002f,0x000d,0x000a,0x000d,
608     0x000a,0x0020,0x0020,0x0072,0x0065,
609     0x0061,0x0064,0x006d,0x0065,0x002e,
610     0x0074,0x0078,0x0074,0x0020,0x002d,
611     0x002d,0x002d,0x0020,0x82f1,0x8a9e,
612     0x0052,0x0045,0x0041,0x0044,0x004d,
613     0x0045,0x0020,0x0020,0x0020,0x0020,
614     0x0020,0x0028,0x0041,0x0053,0x0043,
615     0x0049,0x0049,0x0029,0x000d,0x000a,
616     0x0020,0x0020,0x0072,0x0065,0x0061,
617     0x0064,0x006d,0x0065,0x002e,0x0065,
618     0x0075,0x0063,0x0020,0x002d,0x002d,
619     0x002d,0x0020,0x3053,0x306e,0x30d5,
620     0x30a1,0x30a4,0x30eb,0x0020,0x0020,
621     0x0020,0x0028,0x0045,0x0055,0x0043,
622     0x002d,0x004a,0x0050,0x0029,0x000d,
623     0x000a,0x0020,0x0020,0x0072,0x0065,
624     0x0061,0x0064,0x006d,0x0065,0x002e,
625     0x006a,0x0069,0x0073,0x0020,0x002d,
626     0x002d,0x002d,0x0020,0x65e5,0x672c,
627     0x8a9e,0x0052,0x0045,0x0041,0x0044,
628     0x004d,0x0045,0x0020,0x0020,0x0020,
629     0x0028,0x004a,0x0049,0x0053,0x0029,
630     0x000d,0x000a,0x0020,0x0020,0x0072,
631     0x0065,0x0061,0x0064,0x006d,0x0065,
632     0x002e,0x0073,0x006a,0x0073,0x0020,
633     0x002d,0x002d,0x002d,0x0020,0x65e5,
634     0x672c,0x8a9e,0x0052,0x0045,0x0041,
635     0x0044,0x004d,0x0045,0x0020,0x0020,
636     0x0020,0x0028,0x0053,0x0068,0x0069,
637     0x0066,0x0074,0x005f,0x004a,0x0049,
638     0x0053,0x0029,0x000d,0x000a,0x000d,
639     0x000a,0x006a,0x0074,0x0065,0x0078,
640     0x0074,0x002f,0x0063,0x0072,0x002f,
641     0x000d,0x000a,0x006a,0x0074,0x0065,
642     0x0078,0x0074,0x002f,0x0063,0x0072,
643     0x006c,0x0066,0x002f,0x000d,0x000a,
644     0x006a,0x0074,0x0065,0x0078,0x0074,
645     0x002f,0x006c,0x0066,0x002f,0x000d,
646     0x000a,0x000d,0x000a,0x0020,0x0020,
647     0x0061,0x0073,0x0063,0x0069,0x0069,
648     0x002e,0x0074,0x0078,0x0074,0x0020,
649     0x002d,0x002d,0x002d,0x002d,0x0020,
650     0x0041,0x0053,0x0043,0x0049,0x0049,
651     0x3067,0x66f8,0x3044,0x305f,0x65e5,
652     0x672c,0x8a9e,0x0028,0x30ed,0x30fc,
653     0x30de,0x5b57,0x0029,0x000d,0x000a,
654     0x000d,0x000a,0x0020,0x0020,0x006a,
655     0x0030,0x0032,0x0030,0x0031,0x002d,
656     0x0038,0x0062,0x002e,0x0074,0x0078,
657     0x0074,0x0020,0x002d,0x0020,0x004a,
658     0x0049,0x0053,0x0020,0x0058,0x0030,
659     0x0032,0x0030,0x0031,0x306e,0x7247,
660     0x4eee,0x540d,0x0020,0x3092,0x0020,
661     0x0038,0x5358,0x4f4d,0x7b26,0x53f7,
662     0x5316,0x0020,0x0020,0x0020,0x0020,
663     0x0020,0x0020,0x0020,0x0053,0x0068,
664     0x0069,0x0066,0x0074,0x005f,0x004a,
665     0x0049,0x0053,0x3068,0x540c,0x3058,
666     0x000d,0x000a,0x0020,0x0020,0x006a,
667     0x0030,0x0032,0x0030,0x0031,0x002d,
668     0x0065,0x0073,0x002e,0x0074,0x0078,
669     0x0074,0x0020,0x002d,0x0020,0x004a,
670     0x0049,0x0053,0x0020,0x0058,0x0030,
671     0x0032,0x0030,0x0031,0x306e,0x7247,
672     0x4eee,0x540d,0x0020,0x3092,0x0020,
673     0x0045,0x0053,0x0043,0x0028,0x0049,
674     0x3067,0x7b26,0x53f7,0x5316,0x000d,
675     0x000a,0x0020,0x0020,0x006a,0x0030,
676     0x0032,0x0030,0x0031,0x002d,0x0073,
677     0x006f,0x002e,0x0074,0x0078,0x0074,
678     0x0020,0x002d,0x0020,0x004a,0x0049,
679     0x0053,0x0020,0x0058,0x0030,0x0032,
680     0x0030,0x0031,0x306e,0x7247,0x4eee,
681     0x540d,0x0020,0x3092,0x0020,0x0053,
682     0x004f,0x002f,0x0053,0x0049,0x3067,
683     0x7b26,0x53f7,0x5316,0x000d,0x000a,
684     0x000d,0x000a,0x0020,0x0020,0x006a,
685     0x0030,0x0032,0x0030,0x0038,0x002d,
686     0x0038,0x0062,0x002e,0x0074,0x0078,
687     0x0074,0x0020,0x002d,0x0020,0x004a,
688     0x0049,0x0053,0x0020,0x0058,0x0030,
689     0x0032,0x0030,0x0038,0x0020,0x0020,
690     0x0020,0x0020,0x0020,0x0020,0x0020,
691     0x0020,0x0020,0x3092,0x0020,0x0038,
692     0x5358,0x4f4d,0x7b26,0x53f7,0x5316,
693     0x0020,0x0020,0x0020,0x0020,0x0020,
694     0x0020,0x0020,0x0045,0x0055,0x0043,
695     0x002d,0x004a,0x0050,0x3068,0x540c,
696     0x3058,0x000d,0x000a,0x0020,0x0020,
697     0x006a,0x0030,0x0032,0x0030,0x0038,
698     0x002d,0x0037,0x0038,0x002e,0x0074,
699     0x0078,0x0074,0x0020,0x002d,0x0020,
700     0x004a,0x0049,0x0053,0x0020,0x0058,
701     0x0030,0x0032,0x0030,0x0038,0x0020,
702     0x0020,0x0020,0x0020,0x0020,0x0020,
703     0x0020,0x0020,0x0020,0x3092,0x0020,
704     0x0045,0x0053,0x0043,0x0024,0x0040,
705     0x3067,0x7b26,0x53f7,0x5316,0x0020,
706     0x0020,0x0020,0x0020,0x0020,0x3044,
707     0x308f,0x3086,0x308b,0x65e7,0x004a,
708     0x0049,0x0053,0x000d,0x000a,0x0020,
709     0x0020,0x006a,0x0030,0x0032,0x0030,
710     0x0038,0x002d,0x0038,0x0033,0x002e,
711     0x0074,0x0078,0x0074,0x0020,0x002d,
712     0x0020,0x004a,0x0049,0x0053,0x0020,
713     0x0058,0x0030,0x0032,0x0030,0x0038,
714     0x0020,0x0020,0x0020,0x0020,0x0020,
715     0x0020,0x0020,0x0020,0x0020,0x3092,
716     0x0020,0x0045,0x0053,0x0043,0x0024,
717     0x0042,0x3067,0x7b26,0x53f7,0x5316,
718     0x0020,0x0020,0x0020,0x0020,0x0020,
719     0x3044,0x308f,0x3086,0x308b,0x65b0,
720     0x004a,0x0049,0x0053,0x000d,0x000a,
721     0x000d,0x000a,0x0020,0x0020,0x0065,
722     0x0030,0x0032,0x0030,0x0031,0x002e,
723     0x0074,0x0078,0x0074,0x0020,0x002d,
724     0x002d,0x002d,0x002d,0x0020,0x004a,
725     0x0049,0x0053,0x0020,0x0058,0x0030,
726     0x0032,0x0030,0x0031,0x306e,0x7247,
727     0x4eee,0x540d,0x0020,0x3092,0x0020,
728     0x0045,0x0055,0x0043,0x002d,0x004a,
729     0x0050,0x3067,0x7b26,0x53f7,0x5316,
730     0x000d,0x000a,0x0020,0x0020,0x0065,
731     0x0030,0x0032,0x0030,0x0038,0x002e,
732     0x0074,0x0078,0x0074,0x0020,0x002d,
733     0x002d,0x002d,0x002d,0x0020,0x004a,
734     0x0049,0x0053,0x0020,0x0058,0x0030,
735     0x0032,0x0030,0x0038,0x0020,0x0020,
736     0x0020,0x0020,0x0020,0x0020,0x0020,
737     0x0020,0x0020,0x3092,0x0020,0x0045,
738     0x0055,0x0043,0x002d,0x004a,0x0050,
739     0x3067,0x7b26,0x53f7,0x5316,0x0020,
740     0x0020,0x0020,0x0020,0x0038,0x30d3,
741     0x30c3,0x30c8,0x004a,0x0049,0x0053,
742     0x0058,0x0030,0x0032,0x0030,0x0038,
743     0x3068,0x540c,0x3058,0x000d,0x000a,
744     0x000d,0x000a,0x0020,0x0020,0x0073,
745     0x0030,0x0032,0x0030,0x0031,0x002e,
746     0x0074,0x0078,0x0074,0x0020,0x002d,
747     0x002d,0x002d,0x002d,0x0020,0x004a,
748     0x0049,0x0053,0x0020,0x0058,0x0030,
749     0x0032,0x0030,0x0031,0x0020,0x0020,
750     0x0020,0x0020,0x0020,0x0020,0x0020,
751     0x0020,0x0020,0x3092,0x0020,0x0053,
752     0x0068,0x0069,0x0066,0x0074,0x005f,
753     0x004a,0x0049,0x0053,0x3067,0x7b26,
754     0x53f7,0x5316,0x0020,0x0038,0x30d3,
755     0x30c3,0x30c8,0x004a,0x0049,0x0053,
756     0x0058,0x0030,0x0032,0x0030,0x0031,
757     0x3068,0x540c,0x3058,0x000d,0x000a,
758     0x0020,0x0020,0x0073,0x0030,0x0032,
759     0x0030,0x0038,0x002e,0x0074,0x0078,
760     0x0074,0x0020,0x002d,0x002d,0x002d,
761     0x002d,0x0020,0x004a,0x0049,0x0053,
762     0x0020,0x0058,0x0030,0x0032,0x0030,
763     0x0038,0x0020,0x0020,0x0020,0x0020,
764     0x0020,0x0020,0x0020,0x0020,0x0020,
765     0x3092,0x0020,0x0053,0x0068,0x0069,
766     0x0066,0x0074,0x005f,0x004a,0x0049,
767     0x0053,0x3067,0x7b26,0x53f7,0x5316,
768     0x000d,0x000a,0x000d,0x000a,0x006a,
769     0x0074,0x0065,0x0078,0x0074,0x002f,
770     0x006f,0x0074,0x0068,0x0065,0x0072,
771     0x0073,0x002f,0x000d,0x000a,0x000d,
772     0x000a,0x0020,0x0020,0x0062,0x0036,
773     0x0034,0x006a,0x0069,0x0073,0x002e,
774     0x0074,0x0078,0x0074,0x0020,0x002d,
775     0x002d,0x002d,0x0020,0x0049,0x0053,
776     0x004f,0x002d,0x0032,0x0030,0x0032,
777     0x0032,0x002d,0x004a,0x0050,0x0020,
778     0x0028,0x004a,0x0049,0x0053,0x0029,
779     0x0020,0x3092,0x0020,0x0062,0x0061,
780     0x0073,0x0065,0x0036,0x0034,0x3067,
781     0x7b26,0x53f7,0x5316,0x000d,0x000a,
782     0x0020,0x0020,0x0071,0x0074,0x006a,
783     0x0069,0x0073,0x002e,0x0074,0x0078,
784     0x0074,0x0020,0x002d,0x002d,0x002d,
785     0x002d,0x0020,0x0049,0x0053,0x004f,
786     0x002d,0x0032,0x0030,0x0032,0x0032,
787     0x002d,0x004a,0x0050,0x0020,0x0028,
788     0x004a,0x0049,0x0053,0x0029,0x0020,
789     0x3092,0x0020,0x0071,0x0075,0x006f,
790     0x0074,0x0065,0x0064,0x002d,0x0070,
791     0x0072,0x0069,0x006e,0x0074,0x0061,
792     0x0062,0x006c,0x0065,0x3067,0x7b26,
793     0x53f7,0x5316,0x000d,0x000a,0x000d,
794     0x000a,0x0020,0x0020,0x0062,0x006b,
795     0x0065,0x0075,0x0063,0x002e,0x0074,
796     0x0078,0x0074,0x0020,0x002d,0x002d,
797     0x002d,0x002d,0x0020,0x58ca,0x308c,
798     0x305f,0x0045,0x0055,0x0043,0x002d,
799     0x004a,0x0050,0x0020,0x0020,0x0020,
800     0x0020,0x0020,0x0020,0x5148,0x982d,
801     0x30d3,0x30c3,0x30c8,0x304c,0x30bc,
802     0x30ed,0x000d,0x000a,0x0020,0x0020,
803     0x0062,0x006b,0x006a,0x0069,0x0073,
804     0x002e,0x0074,0x0078,0x0074,0x0020,
805     0x002d,0x002d,0x002d,0x002d,0x0020,
806     0x58ca,0x308c,0x305f,0x004a,0x0049,
807     0x0053,0x0020,0x0020,0x0020,0x0020,
808     0x0020,0x0020,0x0020,0x0020,0x0020,
809     0x0045,0x0053,0x0043,0x30b3,0x30fc,
810     0x30c9,0x304c,0x6b20,0x3051,0x305f,
811     0x000d,0x000a,0x0020,0x0020,0x0062,
812     0x006b,0x0073,0x006a,0x0069,0x0073,
813     0x002e,0x0074,0x0078,0x0074,0x002d,
814     0x002d,0x002d,0x002d,0x0020,0x58ca,
815     0x308c,0x305f,0x0053,0x0068,0x0069,
816     0x0066,0x0074,0x005f,0x004a,0x0049,
817     0x0053,0x0020,0x0020,0x0020,0x5148,
818     0x982d,0x30d3,0x30c3,0x30c8,0x304c,
819     0x30bc,0x30ed,0x000d,0x000a,0x000d,
820     0x000a,0x0020,0x0020,0x0063,0x0074,
821     0x0072,0x006c,0x005f,0x007a,0x002e,
822     0x0074,0x0078,0x0074,0x0020,0x0020,
823     0x0020,0x0020,0x0020,0x0053,0x0068,
824     0x0069,0x0066,0x0074,0x005f,0x004a,
825     0x0049,0x0053,0x0020,0x0020,0x0020,
826     0x0020,0x0020,0x0020,0x005e,0x005a,
827     0x30ad,0x30e3,0x30e9,0x30af,0x30bf,
828     0x4ed8,0x304d,0x0020,0x0020,0x0020,
829     0x0028,0x0044,0x004f,0x0053,0x98a8,
830     0x0029,0x000d,0x000a,0x0020,0x0020,
831     0x006d,0x0061,0x0063,0x0074,0x0078,
832     0x0074,0x002e,0x0062,0x0069,0x006e,
833     0x0020,0x0020,0x0020,0x0020,0x0020,
834     0x30de,0x30c3,0x30af,0x30d0,0x30a4,
835     0x30ca,0x30ea,0x0049,0x0049,0x30d5,
836     0x30a9,0x30fc,0x30de,0x30c3,0x30c8,
837     0x000d,0x000a
838 };
839 #endif
840 
841 struct iconv_data
842 {
843     size_t len;
844     char *name;
845     char *data;
846 };
847 
848 #define CONVERSIONS 4
849 
850 struct iconv_data data[] =
851 {
852 #if defined(_ICONV_FROM_ENCODING_EUC_JP) && defined(_ICONV_TO_ENCODING_EUC_JP)
853     {sizeof(euc_jp), "EUC-JP", (char *)euc_jp},
854 #endif
855 #if defined(_ICONV_FROM_ENCODING_SHIFT_JIS) && defined(_ICONV_TO_ENCODING_SHIFT_JIS)
856     {sizeof(shift_jis), "SHIFT-JIS", (char *)shift_jis},
857 #endif
858 #if defined(_ICONV_FROM_ENCODING_UTF_8) && defined(_ICONV_TO_ENCODING_UTF_8)
859     {sizeof(utf8), "UTF-8", (char *)utf8},
860 #endif
861 #if defined(_ICONV_FROM_ENCODING_UCS_2_INTERNAL) && defined(_ICONV_TO_ENCODING_UCS_2_INTERNAL)
862     {sizeof(ucs2), "UCS-2-INTERNAL", (char *)ucs2},
863 #endif
864     {0, NULL, NULL}
865 };
866 
867 #define OUTBUF_LEN 2800
868 char ob[OUTBUF_LEN];
869 
870 iconv_t descs[CONVERSIONS*CONVERSIONS];
871 
872 #define ERROR 0
873 
874 #ifndef TEST_NLSPATH
875 #define TEST_NLSPATH "./"
876 #endif
877 
main(void)878 int main(void)
879 {
880     int i, j, d = 0;
881     unsigned k;
882     size_t n;
883     char *outbuf, *inbuf;
884     int conversions = sizeof(data)/sizeof(struct iconv_data) - 1;
885 
886     CHECK(setenv("NLSPATH", TEST_NLSPATH, 0) != -1);
887 
888     puts("JP iconv test");
889 
890     for (i = 0; i < conversions; i++)
891     {
892         for (j = 0; j < conversions; j++)
893 	{
894 	    descs[d] = iconv_open(data[j].name, data[i].name);
895 	    if (descs[d++] == (iconv_t)-1)
896 	    {
897 	        printf("iconv_open(%s, %s)\n", data[i].name, data[j].name);
898 	        perror("");
899                 CHECK(ERROR);
900 	    }
901 	}
902     }
903 
904     d = 0;
905     for (i = 0; i < conversions; i++)
906     {
907         for (j = 0; j < conversions; j++)
908 	{
909 	    size_t inbytes = data[i].len;
910 	    size_t outbytes = OUTBUF_LEN;
911 	    inbuf = data[i].data;
912 	    outbuf = (char *)ob;
913 
914 	    if (iconv(descs[d], NULL, NULL, (char **)&outbuf, &outbytes)                                                                       == (size_t)-1)
915             {
916                 perror("Can't reset shift state");
917                 CHECK(ERROR);
918             }
919 
920             n = iconv(descs[d++], (const char **)&(inbuf), &inbytes,
921 	                          (char **)&outbuf, &outbytes);
922             if (n == (size_t)-1)
923             {
924 	        printf("Conversion from %s to %s FAILED - iconv() "
925                        "returned -1\n", data[i].name, data[j].name);
926 		perror("");
927                 CHECK(ERROR);
928             }
929 
930 	    if (data[j].len != OUTBUF_LEN - outbytes)
931 	    {
932                 printf("Conversion from %s to %s FAILED",
933                        data[i].name, data[j].name);
934 	        printf(" - bad output buffer length (%ld instead of %lu)\n",
935 		       OUTBUF_LEN - (long) outbytes, (unsigned long) data[j].len);
936                 CHECK(ERROR);
937 	    }
938 
939 	    for (k = 0; k < data[j].len; k++)
940 	    {
941 	        if (ob[k] != data[j].data[k])
942 		{
943                     printf("Conversion from %s to %s FAILED",
944                            data[i].name, data[j].name);
945    	            printf("Error: byte %d is wrong\n", k);
946 		    printf("outbuf value: %#x, inbuf value %#x, "
947 		           "right value: %#x\n",
948           	           (int)ob[k], (int)(data[i].data[k]),
949 		           (int)(data[j].data[k]));
950                     CHECK(ERROR);
951 		}
952 	    }
953 
954 	    printf("iconv from %s to %s was successfully done\n",
955                    data[i].name, data[j].name);
956 
957 	}
958     }
959 
960     d = 0;
961     for (i = 0; i < conversions; i++)
962         for (j = 0; j < conversions; j++)
963             CHECK(iconv_close(descs[d++]) != -1);
964 
965     exit(0);
966 }
967 
968 #else /* #if defined(_ICONV_FROM_ENCODING_UTF_8) || ... */
main(int argc,char ** argv)969 int main(int argc, char **argv)
970 {
971     puts("None of UTF-8, EUC-JP, SHIFT-JIS and UCS-2_INTERNAL converters "
972          "linked, SKIP test");
973     exit(0);
974 }
975 #endif /* #if defined(_ICONV_FROM_ENCODING_UTF_8) || ... */
976