1
/* Copyright (C) 2000 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#include "mysys_priv.h"
19
Include all compiled character sets into the client
20
If a client don't want to use all of them, he can define his own
21
init_compiled_charsets() that only adds those that he wants
24
#ifdef HAVE_UCA_COLLATIONS
26
#ifdef HAVE_CHARSET_ucs2
27
extern CHARSET_INFO my_charset_ucs2_icelandic_uca_ci;
28
extern CHARSET_INFO my_charset_ucs2_latvian_uca_ci;
29
extern CHARSET_INFO my_charset_ucs2_romanian_uca_ci;
30
extern CHARSET_INFO my_charset_ucs2_slovenian_uca_ci;
31
extern CHARSET_INFO my_charset_ucs2_polish_uca_ci;
32
extern CHARSET_INFO my_charset_ucs2_estonian_uca_ci;
33
extern CHARSET_INFO my_charset_ucs2_spanish_uca_ci;
34
extern CHARSET_INFO my_charset_ucs2_swedish_uca_ci;
35
extern CHARSET_INFO my_charset_ucs2_turkish_uca_ci;
36
extern CHARSET_INFO my_charset_ucs2_czech_uca_ci;
37
extern CHARSET_INFO my_charset_ucs2_danish_uca_ci;
38
extern CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci;
39
extern CHARSET_INFO my_charset_ucs2_slovak_uca_ci;
40
extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
41
extern CHARSET_INFO my_charset_ucs2_roman_uca_ci;
42
extern CHARSET_INFO my_charset_ucs2_persian_uca_ci;
43
extern CHARSET_INFO my_charset_ucs2_esperanto_uca_ci;
44
extern CHARSET_INFO my_charset_ucs2_hungarian_uca_ci;
45
extern CHARSET_INFO my_charset_ucs2_sinhala_uca_ci;
46
#endif /* HAVE_CHARSET_ucs2 */
49
#ifdef HAVE_CHARSET_utf32
50
extern CHARSET_INFO my_charset_utf32_icelandic_uca_ci;
51
extern CHARSET_INFO my_charset_utf32_latvian_uca_ci;
52
extern CHARSET_INFO my_charset_utf32_romanian_uca_ci;
53
extern CHARSET_INFO my_charset_utf32_slovenian_uca_ci;
54
extern CHARSET_INFO my_charset_utf32_polish_uca_ci;
55
extern CHARSET_INFO my_charset_utf32_estonian_uca_ci;
56
extern CHARSET_INFO my_charset_utf32_spanish_uca_ci;
57
extern CHARSET_INFO my_charset_utf32_swedish_uca_ci;
58
extern CHARSET_INFO my_charset_utf32_turkish_uca_ci;
59
extern CHARSET_INFO my_charset_utf32_czech_uca_ci;
60
extern CHARSET_INFO my_charset_utf32_danish_uca_ci;
61
extern CHARSET_INFO my_charset_utf32_lithuanian_uca_ci;
62
extern CHARSET_INFO my_charset_utf32_slovak_uca_ci;
63
extern CHARSET_INFO my_charset_utf32_spanish2_uca_ci;
64
extern CHARSET_INFO my_charset_utf32_roman_uca_ci;
65
extern CHARSET_INFO my_charset_utf32_persian_uca_ci;
66
extern CHARSET_INFO my_charset_utf32_esperanto_uca_ci;
67
extern CHARSET_INFO my_charset_utf32_hungarian_uca_ci;
68
extern CHARSET_INFO my_charset_utf32_sinhala_uca_ci;
69
#endif /* HAVE_CHARSET_utf32 */
72
#ifdef HAVE_CHARSET_utf16
73
extern CHARSET_INFO my_charset_utf16_icelandic_uca_ci;
74
extern CHARSET_INFO my_charset_utf16_latvian_uca_ci;
75
extern CHARSET_INFO my_charset_utf16_romanian_uca_ci;
76
extern CHARSET_INFO my_charset_utf16_slovenian_uca_ci;
77
extern CHARSET_INFO my_charset_utf16_polish_uca_ci;
78
extern CHARSET_INFO my_charset_utf16_estonian_uca_ci;
79
extern CHARSET_INFO my_charset_utf16_spanish_uca_ci;
80
extern CHARSET_INFO my_charset_utf16_swedish_uca_ci;
81
extern CHARSET_INFO my_charset_utf16_turkish_uca_ci;
82
extern CHARSET_INFO my_charset_utf16_czech_uca_ci;
83
extern CHARSET_INFO my_charset_utf16_danish_uca_ci;
84
extern CHARSET_INFO my_charset_utf16_lithuanian_uca_ci;
85
extern CHARSET_INFO my_charset_utf16_slovak_uca_ci;
86
extern CHARSET_INFO my_charset_utf16_spanish2_uca_ci;
87
extern CHARSET_INFO my_charset_utf16_roman_uca_ci;
88
extern CHARSET_INFO my_charset_utf16_persian_uca_ci;
89
extern CHARSET_INFO my_charset_utf16_esperanto_uca_ci;
90
extern CHARSET_INFO my_charset_utf16_hungarian_uca_ci;
91
extern CHARSET_INFO my_charset_utf16_sinhala_uca_ci;
92
#endif /* HAVE_CHARSET_utf16 */
95
#ifdef HAVE_CHARSET_utf8mb3
96
extern CHARSET_INFO my_charset_utf8mb3_icelandic_uca_ci;
97
extern CHARSET_INFO my_charset_utf8mb3_latvian_uca_ci;
98
extern CHARSET_INFO my_charset_utf8mb3_romanian_uca_ci;
99
extern CHARSET_INFO my_charset_utf8mb3_slovenian_uca_ci;
100
extern CHARSET_INFO my_charset_utf8mb3_polish_uca_ci;
101
extern CHARSET_INFO my_charset_utf8mb3_estonian_uca_ci;
102
extern CHARSET_INFO my_charset_utf8mb3_spanish_uca_ci;
103
extern CHARSET_INFO my_charset_utf8mb3_swedish_uca_ci;
104
extern CHARSET_INFO my_charset_utf8mb3_turkish_uca_ci;
105
extern CHARSET_INFO my_charset_utf8mb3_czech_uca_ci;
106
extern CHARSET_INFO my_charset_utf8mb3_danish_uca_ci;
107
extern CHARSET_INFO my_charset_utf8mb3_lithuanian_uca_ci;
108
extern CHARSET_INFO my_charset_utf8mb3_slovak_uca_ci;
109
extern CHARSET_INFO my_charset_utf8mb3_spanish2_uca_ci;
110
extern CHARSET_INFO my_charset_utf8mb3_roman_uca_ci;
111
extern CHARSET_INFO my_charset_utf8mb3_persian_uca_ci;
112
extern CHARSET_INFO my_charset_utf8mb3_esperanto_uca_ci;
113
extern CHARSET_INFO my_charset_utf8mb3_hungarian_uca_ci;
114
extern CHARSET_INFO my_charset_utf8mb3_sinhala_uca_ci;
115
#ifdef HAVE_UTF8_GENERAL_CS
116
extern CHARSET_INFO my_charset_utf8mb3_general_cs;
118
#endif /* HAVE_CHARSET_utf8mb3 */
120
#ifdef HAVE_CHARSET_utf8mb4
121
extern CHARSET_INFO my_charset_utf8mb4_icelandic_uca_ci;
122
extern CHARSET_INFO my_charset_utf8mb4_latvian_uca_ci;
123
extern CHARSET_INFO my_charset_utf8mb4_romanian_uca_ci;
124
extern CHARSET_INFO my_charset_utf8mb4_slovenian_uca_ci;
125
extern CHARSET_INFO my_charset_utf8mb4_polish_uca_ci;
126
extern CHARSET_INFO my_charset_utf8mb4_estonian_uca_ci;
127
extern CHARSET_INFO my_charset_utf8mb4_spanish_uca_ci;
128
extern CHARSET_INFO my_charset_utf8mb4_swedish_uca_ci;
129
extern CHARSET_INFO my_charset_utf8mb4_turkish_uca_ci;
130
extern CHARSET_INFO my_charset_utf8mb4_czech_uca_ci;
131
extern CHARSET_INFO my_charset_utf8mb4_danish_uca_ci;
132
extern CHARSET_INFO my_charset_utf8mb4_lithuanian_uca_ci;
133
extern CHARSET_INFO my_charset_utf8mb4_slovak_uca_ci;
134
extern CHARSET_INFO my_charset_utf8mb4_spanish2_uca_ci;
135
extern CHARSET_INFO my_charset_utf8mb4_roman_uca_ci;
136
extern CHARSET_INFO my_charset_utf8mb4_persian_uca_ci;
137
extern CHARSET_INFO my_charset_utf8mb4_esperanto_uca_ci;
138
extern CHARSET_INFO my_charset_utf8mb4_hungarian_uca_ci;
139
extern CHARSET_INFO my_charset_utf8mb4_sinhala_uca_ci;
140
#endif /* HAVE_CHARSET_utf8mb4 */
142
#endif /* HAVE_UCA_COLLATIONS */
145
my_bool init_compiled_charsets(myf flags __attribute__((unused)))
149
add_compiled_collation(&my_charset_bin);
150
add_compiled_collation(&my_charset_filename);
152
add_compiled_collation(&my_charset_latin1);
153
add_compiled_collation(&my_charset_latin1_bin);
154
add_compiled_collation(&my_charset_latin1_german2_ci);
156
#ifdef HAVE_CHARSET_big5
157
add_compiled_collation(&my_charset_big5_chinese_ci);
158
add_compiled_collation(&my_charset_big5_bin);
161
#ifdef HAVE_CHARSET_cp1250
162
add_compiled_collation(&my_charset_cp1250_czech_ci);
165
#ifdef HAVE_CHARSET_cp932
166
add_compiled_collation(&my_charset_cp932_japanese_ci);
167
add_compiled_collation(&my_charset_cp932_bin);
170
#ifdef HAVE_CHARSET_latin2
171
add_compiled_collation(&my_charset_latin2_czech_ci);
174
#ifdef HAVE_CHARSET_eucjpms
175
add_compiled_collation(&my_charset_eucjpms_japanese_ci);
176
add_compiled_collation(&my_charset_eucjpms_bin);
179
#ifdef HAVE_CHARSET_euckr
180
add_compiled_collation(&my_charset_euckr_korean_ci);
181
add_compiled_collation(&my_charset_euckr_bin);
184
#ifdef HAVE_CHARSET_gb2312
185
add_compiled_collation(&my_charset_gb2312_chinese_ci);
186
add_compiled_collation(&my_charset_gb2312_bin);
189
#ifdef HAVE_CHARSET_gbk
190
add_compiled_collation(&my_charset_gbk_chinese_ci);
191
add_compiled_collation(&my_charset_gbk_bin);
194
#ifdef HAVE_CHARSET_sjis
195
add_compiled_collation(&my_charset_sjis_japanese_ci);
196
add_compiled_collation(&my_charset_sjis_bin);
199
#ifdef HAVE_CHARSET_tis620
200
add_compiled_collation(&my_charset_tis620_thai_ci);
201
add_compiled_collation(&my_charset_tis620_bin);
204
#ifdef HAVE_CHARSET_ucs2
205
add_compiled_collation(&my_charset_ucs2_general_ci);
206
add_compiled_collation(&my_charset_ucs2_bin);
207
#ifdef HAVE_UCA_COLLATIONS
208
add_compiled_collation(&my_charset_ucs2_unicode_ci);
209
add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci);
210
add_compiled_collation(&my_charset_ucs2_latvian_uca_ci);
211
add_compiled_collation(&my_charset_ucs2_romanian_uca_ci);
212
add_compiled_collation(&my_charset_ucs2_slovenian_uca_ci);
213
add_compiled_collation(&my_charset_ucs2_polish_uca_ci);
214
add_compiled_collation(&my_charset_ucs2_estonian_uca_ci);
215
add_compiled_collation(&my_charset_ucs2_spanish_uca_ci);
216
add_compiled_collation(&my_charset_ucs2_swedish_uca_ci);
217
add_compiled_collation(&my_charset_ucs2_turkish_uca_ci);
218
add_compiled_collation(&my_charset_ucs2_czech_uca_ci);
219
add_compiled_collation(&my_charset_ucs2_danish_uca_ci);
220
add_compiled_collation(&my_charset_ucs2_lithuanian_uca_ci);
221
add_compiled_collation(&my_charset_ucs2_slovak_uca_ci);
222
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
223
add_compiled_collation(&my_charset_ucs2_roman_uca_ci);
224
add_compiled_collation(&my_charset_ucs2_persian_uca_ci);
225
add_compiled_collation(&my_charset_ucs2_esperanto_uca_ci);
226
add_compiled_collation(&my_charset_ucs2_hungarian_uca_ci);
227
add_compiled_collation(&my_charset_ucs2_sinhala_uca_ci);
231
#ifdef HAVE_CHARSET_ujis
232
add_compiled_collation(&my_charset_ujis_japanese_ci);
233
add_compiled_collation(&my_charset_ujis_bin);
236
#ifdef HAVE_CHARSET_utf8mb3
237
add_compiled_collation(&my_charset_utf8mb3_general_ci);
238
add_compiled_collation(&my_charset_utf8mb3_bin);
239
#ifdef HAVE_UTF8_GENERAL_CS
240
add_compiled_collation(&my_charset_utf8mb3_general_cs);
242
#ifdef HAVE_UCA_COLLATIONS
243
add_compiled_collation(&my_charset_utf8mb3_unicode_ci);
244
add_compiled_collation(&my_charset_utf8mb3_icelandic_uca_ci);
245
add_compiled_collation(&my_charset_utf8mb3_latvian_uca_ci);
246
add_compiled_collation(&my_charset_utf8mb3_romanian_uca_ci);
247
add_compiled_collation(&my_charset_utf8mb3_slovenian_uca_ci);
248
add_compiled_collation(&my_charset_utf8mb3_polish_uca_ci);
249
add_compiled_collation(&my_charset_utf8mb3_estonian_uca_ci);
250
add_compiled_collation(&my_charset_utf8mb3_spanish_uca_ci);
251
add_compiled_collation(&my_charset_utf8mb3_swedish_uca_ci);
252
add_compiled_collation(&my_charset_utf8mb3_turkish_uca_ci);
253
add_compiled_collation(&my_charset_utf8mb3_czech_uca_ci);
254
add_compiled_collation(&my_charset_utf8mb3_danish_uca_ci);
255
add_compiled_collation(&my_charset_utf8mb3_lithuanian_uca_ci);
256
add_compiled_collation(&my_charset_utf8mb3_slovak_uca_ci);
257
add_compiled_collation(&my_charset_utf8mb3_spanish2_uca_ci);
258
add_compiled_collation(&my_charset_utf8mb3_roman_uca_ci);
259
add_compiled_collation(&my_charset_utf8mb3_persian_uca_ci);
260
add_compiled_collation(&my_charset_utf8mb3_esperanto_uca_ci);
261
add_compiled_collation(&my_charset_utf8mb3_hungarian_uca_ci);
262
add_compiled_collation(&my_charset_utf8mb3_sinhala_uca_ci);
263
#endif /* HAVE_UCA_COLLATIONS */
264
#endif /* HAVE_CHARSET_utf8mb3 */
267
#ifdef HAVE_CHARSET_utf8mb4
268
add_compiled_collation(&my_charset_utf8mb4_general_ci);
269
add_compiled_collation(&my_charset_utf8mb4_bin);
270
#ifdef HAVE_UCA_COLLATIONS
271
add_compiled_collation(&my_charset_utf8mb4_unicode_ci);
272
add_compiled_collation(&my_charset_utf8mb4_icelandic_uca_ci);
273
add_compiled_collation(&my_charset_utf8mb4_latvian_uca_ci);
274
add_compiled_collation(&my_charset_utf8mb4_romanian_uca_ci);
275
add_compiled_collation(&my_charset_utf8mb4_slovenian_uca_ci);
276
add_compiled_collation(&my_charset_utf8mb4_polish_uca_ci);
277
add_compiled_collation(&my_charset_utf8mb4_estonian_uca_ci);
278
add_compiled_collation(&my_charset_utf8mb4_spanish_uca_ci);
279
add_compiled_collation(&my_charset_utf8mb4_swedish_uca_ci);
280
add_compiled_collation(&my_charset_utf8mb4_turkish_uca_ci);
281
add_compiled_collation(&my_charset_utf8mb4_czech_uca_ci);
282
add_compiled_collation(&my_charset_utf8mb4_danish_uca_ci);
283
add_compiled_collation(&my_charset_utf8mb4_lithuanian_uca_ci);
284
add_compiled_collation(&my_charset_utf8mb4_slovak_uca_ci);
285
add_compiled_collation(&my_charset_utf8mb4_spanish2_uca_ci);
286
add_compiled_collation(&my_charset_utf8mb4_roman_uca_ci);
287
add_compiled_collation(&my_charset_utf8mb4_persian_uca_ci);
288
add_compiled_collation(&my_charset_utf8mb4_esperanto_uca_ci);
289
add_compiled_collation(&my_charset_utf8mb4_hungarian_uca_ci);
290
add_compiled_collation(&my_charset_utf8mb4_sinhala_uca_ci);
291
#endif /* HAVE_UCA_COLLATIONS */
292
#endif /* HAVE_CHARSET_utf8mb4 */
295
#ifdef HAVE_CHARSET_utf16
296
add_compiled_collation(&my_charset_utf16_general_ci);
297
add_compiled_collation(&my_charset_utf16_bin);
298
#ifdef HAVE_UCA_COLLATIONS
299
add_compiled_collation(&my_charset_utf16_unicode_ci);
300
add_compiled_collation(&my_charset_utf16_icelandic_uca_ci);
301
add_compiled_collation(&my_charset_utf16_latvian_uca_ci);
302
add_compiled_collation(&my_charset_utf16_romanian_uca_ci);
303
add_compiled_collation(&my_charset_utf16_slovenian_uca_ci);
304
add_compiled_collation(&my_charset_utf16_polish_uca_ci);
305
add_compiled_collation(&my_charset_utf16_estonian_uca_ci);
306
add_compiled_collation(&my_charset_utf16_spanish_uca_ci);
307
add_compiled_collation(&my_charset_utf16_swedish_uca_ci);
308
add_compiled_collation(&my_charset_utf16_turkish_uca_ci);
309
add_compiled_collation(&my_charset_utf16_czech_uca_ci);
310
add_compiled_collation(&my_charset_utf16_danish_uca_ci);
311
add_compiled_collation(&my_charset_utf16_lithuanian_uca_ci);
312
add_compiled_collation(&my_charset_utf16_slovak_uca_ci);
313
add_compiled_collation(&my_charset_utf16_spanish2_uca_ci);
314
add_compiled_collation(&my_charset_utf16_roman_uca_ci);
315
add_compiled_collation(&my_charset_utf16_persian_uca_ci);
316
add_compiled_collation(&my_charset_utf16_esperanto_uca_ci);
317
add_compiled_collation(&my_charset_utf16_hungarian_uca_ci);
318
add_compiled_collation(&my_charset_utf16_sinhala_uca_ci);
319
#endif /* HAVE_UCA_COLLATIOINS */
320
#endif /* HAVE_CHARSET_utf16 */
323
#ifdef HAVE_CHARSET_utf32
324
add_compiled_collation(&my_charset_utf32_general_ci);
325
add_compiled_collation(&my_charset_utf32_bin);
326
#ifdef HAVE_UCA_COLLATIONS
327
add_compiled_collation(&my_charset_utf32_unicode_ci);
328
add_compiled_collation(&my_charset_utf32_icelandic_uca_ci);
329
add_compiled_collation(&my_charset_utf32_latvian_uca_ci);
330
add_compiled_collation(&my_charset_utf32_romanian_uca_ci);
331
add_compiled_collation(&my_charset_utf32_slovenian_uca_ci);
332
add_compiled_collation(&my_charset_utf32_polish_uca_ci);
333
add_compiled_collation(&my_charset_utf32_estonian_uca_ci);
334
add_compiled_collation(&my_charset_utf32_spanish_uca_ci);
335
add_compiled_collation(&my_charset_utf32_swedish_uca_ci);
336
add_compiled_collation(&my_charset_utf32_turkish_uca_ci);
337
add_compiled_collation(&my_charset_utf32_czech_uca_ci);
338
add_compiled_collation(&my_charset_utf32_danish_uca_ci);
339
add_compiled_collation(&my_charset_utf32_lithuanian_uca_ci);
340
add_compiled_collation(&my_charset_utf32_slovak_uca_ci);
341
add_compiled_collation(&my_charset_utf32_spanish2_uca_ci);
342
add_compiled_collation(&my_charset_utf32_roman_uca_ci);
343
add_compiled_collation(&my_charset_utf32_persian_uca_ci);
344
add_compiled_collation(&my_charset_utf32_esperanto_uca_ci);
345
add_compiled_collation(&my_charset_utf32_hungarian_uca_ci);
346
add_compiled_collation(&my_charset_utf32_sinhala_uca_ci);
347
#endif /* HAVE_UCA_COLLATIONS */
348
#endif /* HAVE_CHARSET_utf32 */
351
/* Copy compiled charsets */
352
for (cs=compiled_charsets; cs->name; cs++)
353
add_compiled_collation(cs);