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 <my_global.h>
19
#include <mysql_version.h>
23
static void _print_array(uint8 *data, uint size)
26
for (i = 0; i < size; ++i)
28
if (i == 0 || i % 16 == size % 16) printf(" ");
29
printf(" %02x", data[i]);
30
if ((i+1) % 16 == size % 16) printf("\n");
34
static void _print_csinfo(CHARSET_INFO *cs)
36
printf("%s #%d\n", cs->name, cs->number);
37
printf("ctype:\n"); _print_array(cs->ctype, 257);
38
printf("to_lower:\n"); _print_array(cs->to_lower, 256);
39
printf("to_upper:\n"); _print_array(cs->to_upper, 256);
40
printf("sort_order:\n"); _print_array(cs->sort_order, 256);
41
printf("collate: %3s (%d, %p, %p, %p)\n",
42
cs->strxfrm_multiply ? "yes" : "no",
47
printf("multi-byte: %3s (%d, %p, %p, %p)\n",
48
cs->mbmaxlen > 1 ? "yes" : "no",
56
int main(int argc, char **argv) {
57
const char *the_set = MYSQL_CHARSET;
64
if (argc > argcnt && argv[argcnt][0] == '-' && argv[argcnt][1] == '#')
65
DBUG_PUSH(argv[argcnt++]+2);
68
the_set = argv[argcnt++];
71
charsets_dir = argv[argcnt++];
73
if (!(cs= get_charset_by_name(the_set, MYF(MY_WME))))
76
puts("CHARSET INFO:");
80
#ifdef NOT_USED_ANYMORE
81
cs_list = list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
82
printf("LIST OF CHARSETS (compiled + *.conf):\n%s\n", cs_list);
83
my_free(cs_list,MYF(0));
85
cs_list = list_charsets(MYF(MY_CS_INDEX | MY_CS_LOADED));
86
printf("LIST OF CHARSETS (index + loaded):\n%s\n", cs_list);
87
my_free(cs_list,MYF(0));