diff options
author | unknown <bar@bar.intranet.mysql.r18.ru> | 2004-05-11 13:32:01 +0500 |
---|---|---|
committer | unknown <bar@bar.intranet.mysql.r18.ru> | 2004-05-11 13:32:01 +0500 |
commit | 85723a7d5642490a52c4a96344cf96ba2e70ac02 (patch) | |
tree | 990bfd33643d4aca52ad473afd5e77cb6e4b34a5 /strings/dump_map.c | |
parent | 5063cbb9a642905e15edfa4d49f25d677c8b137f (diff) | |
download | mariadb-git-85723a7d5642490a52c4a96344cf96ba2e70ac02.tar.gz |
Use Windows code page 1252 instead of real ISO 8859-1
strings/dump_map.c:
Produce better formatted dump.
Diffstat (limited to 'strings/dump_map.c')
-rw-r--r-- | strings/dump_map.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/strings/dump_map.c b/strings/dump_map.c index f999160d0d4..708d9139f3c 100644 --- a/strings/dump_map.c +++ b/strings/dump_map.c @@ -1,13 +1,15 @@ #include <stdio.h> #include <string.h> -static void print_short_array(unsigned short *a) +static void print_short_array(unsigned short *a, size_t width) { int i; printf("{\n"); for (i=0; i<=0xFF; i++) { - printf("0x%04X%s%s",(int)a[i],i<0xFF?",":"",(i+1) % 8 ? "" :"\n"); + const char *fmt= (width==4) ? "0x%04X" : "0x%02X"; + printf(fmt,(int)a[i]); + printf("%s%s",i<0xFF?",":"",(i+1) % 8 ? "" :"\n"); } printf("};\n"); @@ -41,7 +43,7 @@ int main(void) } printf("unsigned short cs_to_uni[256]="); - print_short_array(touni); + print_short_array(touni, 4); for (i=0;i<=0xFF;i++) { @@ -53,7 +55,7 @@ int main(void) if (fromstat[i]) { printf("unsigned char pl%02X[256]=",i); - print_short_array(fromuni+i*256); + print_short_array(fromuni+i*256, 2); } } |