diff options
Diffstat (limited to 'strings')
31 files changed, 7172 insertions, 4632 deletions
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index ea6eaa8c25e..60f5b409bfb 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -23,7 +23,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c str2int.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c strxmov.c strxnmov.c xml.c strmov_overlapp.c - my_strchr.c strcont.c strappend.c) + my_strchr.c strcont.c strappend.c json_lib.c) IF(NOT HAVE_STRNLEN) # OSX below 10.7 did not have strnlen diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 6c352db7437..4a3b035aa49 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -25,7 +25,17 @@ #define ROW16_LEN 8 #define MAX_BUF (64*1024) -static struct charset_info_st all_charsets[512]; + +#define MY_ALL_CHARSETS_SIZE 2048 + +static struct charset_info_st all_charsets[MY_ALL_CHARSETS_SIZE]; +static uint refids[MY_ALL_CHARSETS_SIZE]; + +static CHARSET_INFO *inheritance_source(uint id) +{ + return &all_charsets[refids[id]]; +} + void print_array(FILE *f, const char *set, const char *name, const uchar *a, int n) @@ -61,14 +71,30 @@ print_array16(FILE *f, const char *set, const char *name, const uint16 *a, int n } -static int get_charset_number(const char *charset_name) +static uint get_collation_number(const char *name) +{ + CHARSET_INFO *cs; + for (cs= all_charsets; + cs < all_charsets + array_elements(all_charsets); + cs++) + { + if (cs->name && !strcmp(cs->name, name)) + return cs->number; + } + return 0; +} + + +static uint +get_charset_number_internal(const char *charset_name, uint cs_flags) { CHARSET_INFO *cs; for (cs= all_charsets; cs < all_charsets + array_elements(all_charsets); cs++) { - if ( cs->name && !strcmp(cs->name, charset_name)) + if (cs->csname && (cs->state & cs_flags) && + !strcmp(cs->csname, charset_name)) return cs->number; } return 0; @@ -93,7 +119,10 @@ static void simple_cs_copy_data(struct charset_info_st *to, CHARSET_INFO *from) if (from->name) to->name= strdup(from->name); - + + if (from->tailoring) + to->tailoring= strdup(from->tailoring); + if (from->ctype) to->ctype= (uchar*) mdup((char*) from->ctype, MY_CS_CTYPE_TABLE_SIZE); if (from->to_lower) @@ -117,17 +146,67 @@ static void simple_cs_copy_data(struct charset_info_st *to, CHARSET_INFO *from) } } + +/* + cs->xxx arrays can be NULL in case when a collation has an entry only + in Index.xml and has no entry in csname.xml (e.g. in case of a binary + collation or a collation using <import> command). + + refcs->xxx arrays can be NULL if <import> refers to a collation + which is not defined in csname.xml, e.g. an always compiled collation + such as latin1_swedish_ci. +*/ +static void inherit_charset_data(struct charset_info_st *cs, + CHARSET_INFO *refcs) +{ + cs->state|= (refcs->state & (MY_CS_PUREASCII|MY_CS_NONASCII)); + if (refcs->ctype && cs->ctype && + !memcmp(cs->ctype, refcs->ctype, MY_CS_CTYPE_TABLE_SIZE)) + cs->ctype= NULL; + if (refcs->to_lower && cs->to_lower && + !memcmp(cs->to_lower, refcs->to_lower, MY_CS_TO_LOWER_TABLE_SIZE)) + cs->to_lower= NULL; + if (refcs->to_upper && cs->to_upper && + !memcmp(cs->to_upper, refcs->to_upper, MY_CS_TO_LOWER_TABLE_SIZE)) + cs->to_upper= NULL; + if (refcs->tab_to_uni && cs->tab_to_uni && + !memcmp(cs->tab_to_uni, refcs->tab_to_uni, + MY_CS_TO_UNI_TABLE_SIZE * sizeof(uint16))) + cs->tab_to_uni= NULL; +} + + +static CHARSET_INFO *find_charset_data_inheritance_source(CHARSET_INFO *cs) +{ + CHARSET_INFO *refcs; + uint refid= get_charset_number_internal(cs->csname, MY_CS_PRIMARY); + return refid && refid != cs->number && + (refcs= &all_charsets[refid]) && + (refcs->state & MY_CS_LOADED) ? refcs : NULL; +} + + +/** + Detect if "cs" needs further loading from csname.xml + @param cs - the character set pointer + @retval FALSE - if the current data (e.g. loaded from from Index.xml) + is not enough to dump the character set and requires + further reading from the csname.xml file. + @retval TRUE - if the current data is enough to dump, + no reading of csname.xml is needed. +*/ static my_bool simple_cs_is_full(CHARSET_INFO *cs) { return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper && cs->to_lower) && (cs->number && cs->name && - (cs->sort_order || (cs->state & MY_CS_BINSORT)))); + (cs->sort_order || cs->tailoring || (cs->state & MY_CS_BINSORT)))); } static int add_collation(struct charset_info_st *cs) { - if (cs->name && (cs->number || (cs->number=get_charset_number(cs->name)))) + if (cs->name && + (cs->number || (cs->number= get_collation_number(cs->name)))) { if (!(all_charsets[cs->number].state & MY_CS_COMPILED)) { @@ -137,6 +216,7 @@ static int add_collation(struct charset_info_st *cs) cs->number= 0; cs->name= NULL; + cs->tailoring= NULL; cs->state= 0; cs->sort_order= NULL; cs->state= 0; @@ -193,12 +273,74 @@ static int my_read_charset_file(const char *filename) return FALSE; } -static int -is_case_sensitive(CHARSET_INFO *cs) + +void print_arrays(FILE *f, CHARSET_INFO *cs) { - return (cs->sort_order && - cs->sort_order['A'] < cs->sort_order['a'] && - cs->sort_order['a'] < cs->sort_order['B']) ? 1 : 0; + if (cs->ctype) + print_array(f, cs->name, "ctype", cs->ctype, MY_CS_CTYPE_TABLE_SIZE); + if (cs->to_lower) + print_array(f, cs->name, "to_lower", cs->to_lower, MY_CS_TO_LOWER_TABLE_SIZE); + if (cs->to_upper) + print_array(f, cs->name, "to_upper", cs->to_upper, MY_CS_TO_UPPER_TABLE_SIZE); + if (cs->sort_order) + print_array(f, cs->name, "sort_order", cs->sort_order, MY_CS_SORT_ORDER_TABLE_SIZE); + if (cs->tab_to_uni) + print_array16(f, cs->name, "to_uni", cs->tab_to_uni, MY_CS_TO_UNI_TABLE_SIZE); +} + + +/** + Print an array member of a CHARSET_INFO. + @param f - the file to print into + @param cs0 - reference to the CHARSET_INFO to print + @param array0 - pointer to the array data (can be NULL) + @param cs1 - reference to the CHARSET_INFO that the data + can be inherited from (e.g. primary collation) + @param array1 - pointer to the array data in cs1 (can be NULL) + @param name - name of the member + + If array0 is not null, then the CHARSET_INFO being dumped has its + own array (e.g. the default collation for the character set). + We print the name of this array using cs0->name and return. + + If array1 is not null, then the CHARSET_INFO being dumpled reuses + the array from another collation. We print the name of the array of + the referenced collation using cs1->name and return. + + Otherwise (if both array0 and array1 are NULL), we have a collation + of a character set whose primary collation is not available now, + and which does not have its own entry in csname.xml file. + + For example, Index.xml has this entry: + <collation name="latin1_swedish_ci_copy"> + <rules> + <import source="latin1_swedish_ci"/> + </rules> + </collation> + and latin1.xml does not have entries for latin1_swedish_ci_copy. + + In such cases we print NULL as a pointer to the array. + It will be set to a not-null data during the first initialization + by the inherit_charset_data() call (see mysys/charset.c for details). +*/ +static void +print_array_ref(FILE *f, + CHARSET_INFO *cs0, const void *array0, + CHARSET_INFO *cs1, const void *array1, + const char *name) +{ + CHARSET_INFO *cs= array0 ? cs0 : array1 ? cs1 : NULL; + if (cs) + fprintf(f," %s_%s, /* %s */\n", + name, cs->name, name); + else + fprintf(f," NULL, /* %s */\n", name); +} + + +static const char *nopad_infix(CHARSET_INFO *cs) +{ + return (cs->state & MY_CS_NOPAD) ? "_nopad" : ""; } @@ -206,28 +348,37 @@ void dispcset(FILE *f,CHARSET_INFO *cs) { fprintf(f,"{\n"); fprintf(f," %d,%d,%d,\n",cs->number,0,0); - fprintf(f," MY_CS_COMPILED%s%s%s%s%s,\n", + fprintf(f," MY_CS_COMPILED%s%s%s%s%s%s,\n", cs->state & MY_CS_BINSORT ? "|MY_CS_BINSORT" : "", cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "", - is_case_sensitive(cs) ? "|MY_CS_CSSORT" : "", - my_charset_is_8bit_pure_ascii(cs) ? "|MY_CS_PUREASCII" : "", - !my_charset_is_ascii_compatible(cs) ? "|MY_CS_NONASCII": ""); + cs->state & MY_CS_CSSORT ? "|MY_CS_CSSORT" : "", + cs->state & MY_CS_PUREASCII ? "|MY_CS_PUREASCII" : "", + cs->state & MY_CS_NONASCII ? "|MY_CS_NONASCII" : "", + cs->state & MY_CS_NOPAD ? "|MY_CS_NOPAD" : ""); if (cs->name) { + CHARSET_INFO *srccs= inheritance_source(cs->number); fprintf(f," \"%s\", /* cset name */\n",cs->csname); fprintf(f," \"%s\", /* coll name */\n",cs->name); fprintf(f," \"\", /* comment */\n"); - fprintf(f," NULL, /* tailoring */\n"); - fprintf(f," ctype_%s, /* ctype */\n",cs->name); - fprintf(f," to_lower_%s, /* lower */\n",cs->name); - fprintf(f," to_upper_%s, /* upper */\n",cs->name); + if (cs->tailoring) + fprintf(f, " \"%s\", /* tailoring */\n", cs->tailoring); + else + fprintf(f," NULL, /* tailoring */\n"); + + print_array_ref(f, cs, cs->ctype, srccs, srccs->ctype, "ctype"); + print_array_ref(f, cs, cs->to_lower, srccs, srccs->to_lower, "to_lower"); + print_array_ref(f, cs, cs->to_upper, srccs, srccs->to_upper, "to_upper"); + if (cs->sort_order) fprintf(f," sort_order_%s, /* sort_order */\n",cs->name); else fprintf(f," NULL, /* sort_order */\n"); + fprintf(f," NULL, /* uca */\n"); - fprintf(f," to_uni_%s, /* to_uni */\n",cs->name); + + print_array_ref(f, cs, cs->tab_to_uni, srccs, srccs->tab_to_uni, "to_uni"); } else { @@ -256,12 +407,13 @@ void dispcset(FILE *f,CHARSET_INFO *cs) fprintf(f," 255, /* max_sort_char */\n"); fprintf(f," ' ', /* pad_char */\n"); fprintf(f," 0, /* escape_with_backslash_is_dangerous */\n"); - + fprintf(f," 1, /* levels_for_order */\n"); fprintf(f," &my_charset_8bit_handler,\n"); + if (cs->state & MY_CS_BINSORT) - fprintf(f," &my_collation_8bit_bin_handler,\n"); + fprintf(f," &my_collation_8bit%s_bin_handler,\n", nopad_infix(cs)); else - fprintf(f," &my_collation_8bit_simple_ci_handler,\n"); + fprintf(f," &my_collation_8bit_simple%s_ci_handler,\n", nopad_infix(cs)); fprintf(f,"}\n"); } @@ -270,9 +422,9 @@ static void fprint_copyright(FILE *file) { fprintf(file, -"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems Inc.\n" -" Copyright 2010-2011 Monty Program Ab\n" -" Copyright (c) 2003, 2011, Oracle and/or its affiliates\n" +"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n" +" Copyright (c) 2000, 2011, Oracle and/or its affiliates.\n" +" Copyright 2008-2016 MariaDB Corporation\n" "\n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" @@ -293,8 +445,7 @@ fprint_copyright(FILE *file) int main(int argc, char **argv __attribute__((unused))) { - struct charset_info_st ncs; - CHARSET_INFO *cs; + struct charset_info_st ncs, *cs; char filename[256]; FILE *f= stdout; @@ -306,6 +457,7 @@ main(int argc, char **argv __attribute__((unused))) bzero((void*)&ncs,sizeof(ncs)); bzero((void*)&all_charsets,sizeof(all_charsets)); + bzero((void*) refids, sizeof(refids)); sprintf(filename,"%s/%s",argv[1],"Index.xml"); my_read_charset_file(filename); @@ -321,6 +473,7 @@ main(int argc, char **argv __attribute__((unused))) sprintf(filename,"%s/%s.xml",argv[1],cs->csname); my_read_charset_file(filename); } + cs->state|= MY_CS_LOADED; } } @@ -333,7 +486,7 @@ main(int argc, char **argv __attribute__((unused))) fprintf(f, " ./conf_to_src ../sql/share/charsets/ > FILE\n"); fprintf(f, "*/\n\n"); fprint_copyright(f); - fprintf(f,"#include <my_global.h>\n"); + fprintf(f,"#include \"strings_def.h\"\n"); fprintf(f,"#include <m_ctype.h>\n\n"); @@ -341,15 +494,18 @@ main(int argc, char **argv __attribute__((unused))) cs < all_charsets + array_elements(all_charsets); cs++) { - if (simple_cs_is_full(cs)) + if (cs->state & MY_CS_LOADED) { + CHARSET_INFO *refcs= find_charset_data_inheritance_source(cs); + cs->state|= my_8bit_charset_flags_from_data(cs) | + my_8bit_collation_flags_from_data(cs); + if (refcs) + { + refids[cs->number]= refcs->number; + inherit_charset_data(cs, refcs); + } fprintf(f,"#ifdef HAVE_CHARSET_%s\n",cs->csname); - print_array(f, cs->name, "ctype", cs->ctype, MY_CS_CTYPE_TABLE_SIZE); - print_array(f, cs->name, "to_lower", cs->to_lower, MY_CS_TO_LOWER_TABLE_SIZE); - print_array(f, cs->name, "to_upper", cs->to_upper, MY_CS_TO_UPPER_TABLE_SIZE); - if (cs->sort_order) - print_array(f, cs->name, "sort_order", cs->sort_order, MY_CS_SORT_ORDER_TABLE_SIZE); - print_array16(f, cs->name, "to_uni", cs->tab_to_uni, MY_CS_TO_UNI_TABLE_SIZE); + print_arrays(f, cs); fprintf(f,"#endif\n"); fprintf(f,"\n"); } @@ -360,7 +516,7 @@ main(int argc, char **argv __attribute__((unused))) cs < all_charsets + array_elements(all_charsets); cs++) { - if (simple_cs_is_full(cs)) + if (cs->state & MY_CS_LOADED) { fprintf(f,"#ifdef HAVE_CHARSET_%s\n",cs->csname); dispcset(f,cs); diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 792c5521cd4..51bf8843d87 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -45,8 +45,6 @@ #define isbig5code(c,d) (isbig5head(c) && isbig5tail(d)) #define big5code(c,d) (((uchar)(c) <<8) | (uchar)(d)) -#define big5head(e) ((uchar)(e>>8)) -#define big5tail(e) ((uchar)(e&0xff)) #define MY_FUNCTION_NAME(x) my_ ## x ## _big5 #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80) @@ -850,99 +848,6 @@ static uint16 big5strokexfrm(uint16 i) } -static size_t -my_strnxfrm_big5(CHARSET_INFO *cs, - uchar *dst, size_t dstlen, uint nweights, - const uchar *src, size_t srclen, uint flags) -{ - uchar *d0= dst; - uchar *de= dst + dstlen; - const uchar *se= src + srclen; - const uchar *sort_order= cs->sort_order; - - for (; dst < de && src < se && nweights; nweights--) - { - if (cs->cset->ismbchar(cs, (const char*) src, (const char*) se)) - { - /* - Note, it is safe not to check (src < se) - in the code below, because ismbchar() would - not return TRUE if src was too short - */ - uint16 e= big5strokexfrm((uint16) big5code(*src, *(src + 1))); - *dst++= big5head(e); - if (dst < de) - *dst++= big5tail(e); - src+= 2; - } - else - *dst++= sort_order ? sort_order[*src++] : *src++; - } - return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); -} - -#if 0 -static int my_strcoll_big5(const uchar *s1, const uchar *s2) -{ - - while (*s1 && *s2) - { - if (*(s1+1) && *(s2+1) && isbig5code(*s1,*(s1+1)) && isbig5code(*s2, *(s2+1))) - { - if (*s1 != *s2 || *(s1+1) != *(s2+1)) - return ((int) big5code(*s1,*(s1+1)) - - (int) big5code(*s2,*(s2+1))); - s1 +=2; - s2 +=2; - } else if (sort_order_big5[(uchar) *s1++] != sort_order_big5[(uchar) *s2++]) - return ((int) sort_order_big5[(uchar) s1[-1]] - - (int) sort_order_big5[(uchar) s2[-1]]); - } - return 0; -} - -static int my_strxfrm_big5(uchar *dest, const uchar *src, int len) -{ - uint16 e; - uchar *d = dest; - - if (len < 1) return 0; - if (!*src) - { - *d = '\0'; - return 0; - } - while (*src && (len > 1)) - { - if (*(src+1) && isbig5code(*src, *(src+1))) - { - e = big5strokexfrm((uint16) big5code(*src, *(src+1))); - *d++ = big5head(e); - *d++ = big5tail(e); - src +=2; - len--; - } else - *d++ = sort_order_big5[(uchar) *src++]; - } - *d = '\0'; - return (int) (d-dest); -} -#endif - - -static uint ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0); -} - - -static uint mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c) -{ - return (isbig5head(c)? 2 : 1); -} - - /* page 0 0xA140-0xC7FC */ static const uint16 tab_big5_uni0[]={ 0x3000,0xFF0C,0x3001,0x3002,0xFF0E,0x2022,0xFF1B,0xFF1A, @@ -6774,6 +6679,8 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _big5_chinese_ci #define WEIGHT_MB1(x) (sort_order_big5[(uchar) (x)]) #define WEIGHT_MB2(x,y) (big5code(x, y)) +#define WEIGHT_MB2_FRM(x,y) (big5strokexfrm((uint16) WEIGHT_MB2(x, y))) +#define DEFINE_STRNXFRM #include "strcoll.ic" @@ -6783,12 +6690,28 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _big5_chinese_nopad_ci +#define WEIGHT_MB1(x) (sort_order_big5[(uchar) (x)]) +#define WEIGHT_MB2(x,y) (big5code(x, y)) +#define WEIGHT_MB2_FRM(x,y) (big5strokexfrm((uint16) WEIGHT_MB2(x, y))) +#define DEFINE_STRNXFRM +#include "strcoll.ic" + + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _big5_nopad_bin +#define WEIGHT_MB1(x) ((uchar) (x)) +#define WEIGHT_MB2(x,y) (big5code(x, y)) +#include "strcoll.ic" + + static MY_COLLATION_HANDLER my_collation_handler_big5_chinese_ci= { NULL, /* init */ my_strnncoll_big5_chinese_ci, my_strnncollsp_big5_chinese_ci, - my_strnxfrm_big5, + my_strnxfrm_big5_chinese_ci, my_strnxfrmlen_simple, my_like_range_mb, my_wildcmp_mb, @@ -6815,14 +6738,43 @@ static MY_COLLATION_HANDLER my_collation_handler_big5_bin= }; +static MY_COLLATION_HANDLER my_collation_handler_big5_chinese_nopad_ci= +{ + NULL, /* init */ + my_strnncoll_big5_chinese_ci, + my_strnncollsp_big5_chinese_nopad_ci, + my_strnxfrm_big5_chinese_nopad_ci, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb, + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_handler_big5_nopad_bin= +{ + NULL, /* init */ + my_strnncoll_big5_bin, + my_strnncollsp_big5_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + static MY_CHARSET_HANDLER my_charset_big5_handler= { NULL, /* init */ - ismbchar_big5, - mbcharlen_big5, my_numchars_mb, my_charpos_mb, - my_well_formed_len_big5, my_lengthsp_8bit, my_numcells_8bit, my_mb_wc_big5, /* mb_wc */ @@ -6916,4 +6868,70 @@ struct charset_info_st my_charset_big5_bin= }; +struct charset_info_st my_charset_big5_chinese_nopad_ci= +{ + MY_NOPAD_ID(1),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NOPAD, /* state */ + "big5", /* cs name */ + "big5_chinese_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_big5, + to_lower_big5, + to_upper_big5, + sort_order_big5, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_big5, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xF9D5, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_big5_handler, + &my_collation_handler_big5_chinese_nopad_ci +}; + + +struct charset_info_st my_charset_big5_nopad_bin= +{ + MY_NOPAD_ID(84),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "big5", /* cs name */ + "big5_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_big5, + to_lower_big5, + to_upper_big5, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_big5, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xF9FE, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_big5_handler, + &my_collation_handler_big5_nopad_bin +}; + + #endif diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 114472b3f10..e4bd6d2b5c2 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -119,9 +119,7 @@ size_t my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)), static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)), const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference - __attribute__((unused))) + const uchar *t, size_t tlen) { return my_strnncoll_binary(cs,s,slen,t,tlen,0); } @@ -139,6 +137,27 @@ static int my_strnncoll_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), /* + Compare a string to an array of spaces, for PAD SPACE behaviour. + @param str - the string + @param length - the length of the string + @return <0 - if a byte less than SPACE was found + @return >0 - if a byte greater than SPACE was found + @return 0 - if the string entirely consists of SPACE characters +*/ +int my_strnncollsp_padspace_bin(const uchar *str, size_t length) +{ + for ( ; length ; str++, length--) + { + if (*str < ' ') + return -1; + else if (*str > ' ') + return 1; + } + return 0; +} + + +/* Compare two strings. Result is sign(first_argument - second_argument) SYNOPSIS @@ -148,9 +167,6 @@ static int my_strnncoll_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), slen Length of 's' t String to compare tlen Length of 't' - diff_if_only_endspace_difference - Set to 1 if the strings should be regarded as different - if they only difference in end space NOTE This function is used for character strings with binary collations. @@ -165,16 +181,10 @@ static int my_strnncoll_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), const uchar *a, size_t a_length, - const uchar *b, size_t b_length, - my_bool diff_if_only_endspace_difference) + const uchar *b, size_t b_length) { const uchar *end; size_t length; - int res; - -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif end= a + (length= MY_MIN(a_length, b_length)); while (a < end) @@ -182,31 +192,19 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), if (*a++ != *b++) return ((int) a[-1] - (int) b[-1]); } - res= 0; - if (a_length != b_length) - { - int swap= 1; - /* - Check the next not space character of the longer key. If it's < ' ', - then it's smaller than the other key. - */ - if (diff_if_only_endspace_difference) - res= 1; /* Assume 'a' is bigger */ - if (a_length < b_length) - { - /* put shorter key in s */ - a_length= b_length; - a= b; - swap= -1; /* swap sign of result */ - res= -res; - } - for (end= a + a_length-length; a < end ; a++) - { - if (*a != ' ') - return (*a < ' ') ? -swap : swap; - } - } - return res; + return a_length == b_length ? 0 : + a_length < b_length ? + -my_strnncollsp_padspace_bin(b, b_length - length) : + my_strnncollsp_padspace_bin(a, a_length - length); +} + + +static int my_strnncollsp_8bit_nopad_bin(CHARSET_INFO * cs + __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length) +{ + return my_strnncoll_8bit_bin(cs, a, a_length, b, b_length, FALSE); } @@ -236,13 +234,6 @@ static int my_strcasecmp_bin(CHARSET_INFO * cs __attribute__((unused)), } -uint my_mbcharlen_8bit(CHARSET_INFO *cs __attribute__((unused)), - uint c __attribute__((unused))) -{ - return 1; -} - - static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *wc, const uchar *str, @@ -271,19 +262,13 @@ int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)), } -void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), - const uchar *key, size_t len, - ulong *nr1, ulong *nr2) +void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2) { + const uchar *end = key + len; ulong tmp1= *nr1; ulong tmp2= *nr2; - /* - Remove trailing spaces. We have to do this to be able to compare - 'A ' and 'A' as identical - */ - const uchar *end = skip_trailing_space(key, len); - for (; key < end ; key++) { MY_HASH_ADD(tmp1, tmp2, (uint) *key); @@ -294,20 +279,16 @@ void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), } -void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)), - const uchar *key, size_t len,ulong *nr1, ulong *nr2) +void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len, + ulong *nr1, ulong *nr2) { - const uchar *end = key + len; - ulong tmp1= *nr1; - ulong tmp2= *nr2; - - for (; key < end ; key++) - { - MY_HASH_ADD(tmp1, tmp2, (uint) *key); - } - - *nr1= tmp1; - *nr2= tmp2; + /* + Remove trailing spaces. We have to do this to be able to compare + 'A ' and 'A' as identical + */ + const uchar *end= skip_trailing_space(key, len); + my_hash_sort_bin(cs, key, end - key, nr1, nr2); } @@ -421,7 +402,22 @@ my_strnxfrm_8bit_bin(CHARSET_INFO *cs, if (dst != src) memcpy(dst, src, srclen); return my_strxfrm_pad_desc_and_reverse(cs, dst, dst + srclen, dst + dstlen, - nweights - srclen, flags, 0); + (uint)(nweights - srclen), flags, 0); +} + + +static size_t +my_strnxfrm_8bit_nopad_bin(CHARSET_INFO *cs, + uchar * dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + set_if_smaller(srclen, dstlen); + set_if_smaller(srclen, nweights); + if (dst != src) + memcpy(dst, src, srclen); + return my_strxfrm_pad_desc_and_reverse_nopad(cs, dst, dst + srclen, + dst + dstlen,(uint)(nweights - srclen), + flags, 0); } @@ -468,13 +464,13 @@ skip: if (nmatch > 0) { match[0].beg= 0; - match[0].end= (size_t) (str- (const uchar*)b-1); + match[0].end= (uint) (str- (const uchar*)b-1); match[0].mb_len= match[0].end; if (nmatch > 1) { match[1].beg= match[0].end; - match[1].end= match[0].end+s_length; + match[1].end= (uint)(match[0].end+s_length); match[1].mb_len= match[1].end-match[1].beg; } } @@ -502,6 +498,22 @@ MY_COLLATION_HANDLER my_collation_8bit_bin_handler = }; +MY_COLLATION_HANDLER my_collation_8bit_nopad_bin_handler = +{ + my_coll_init_8bit_bin, + my_strnncoll_8bit_bin, + my_strnncollsp_8bit_nopad_bin, + my_strnxfrm_8bit_nopad_bin, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_bin, + my_strcasecmp_bin, + my_instr_bin, + my_hash_sort_bin, + my_propagate_simple +}; + + static MY_COLLATION_HANDLER my_collation_binary_handler = { NULL, /* init */ @@ -521,11 +533,8 @@ static MY_COLLATION_HANDLER my_collation_binary_handler = static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - NULL, /* ismbchar */ - my_mbcharlen_8bit, /* mbcharlen */ my_numchars_8bit, my_charpos_8bit, - my_well_formed_len_8bit, my_lengthsp_binary, my_numcells_8bit, my_mb_wc_bin, diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index 2acd4cfebcd..bf97d1feb83 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -191,18 +191,6 @@ static const uchar sort_order_cp932[]= #include "ctype-mb.ic" -static uint ismbchar_cp932(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return (iscp932head((uchar) *p) && (e-p)>1 && iscp932tail((uchar)p[1]) ? 2: 0); -} - -static uint mbcharlen_cp932(CHARSET_INFO *cs __attribute__((unused)),uint c) -{ - return (iscp932head((uchar) c) ? 2 : 1); -} - - #define cp932code(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d)) @@ -34658,6 +34646,22 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _cp932_japanese_nopad_ci +#define WEIGHT_PAD_SPACE (256 * (int) ' ') +#define WEIGHT_MB1(x) (256 * (int) sort_order_cp932[(uchar) (x)]) +#define WEIGHT_MB2(x,y) (cp932code(x, y)) +#include "strcoll.ic" + + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _cp932_nopad_bin +#define WEIGHT_PAD_SPACE (256 * (int) ' ') +#define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) +#define WEIGHT_MB2(x,y) (cp932code(x, y)) +#include "strcoll.ic" + + static MY_COLLATION_HANDLER my_collation_handler_cp932_japanese_ci= { NULL, /* init */ @@ -34690,14 +34694,43 @@ static MY_COLLATION_HANDLER my_collation_handler_cp932_bin= }; +static MY_COLLATION_HANDLER my_collation_handler_cp932_japanese_nopad_ci= +{ + NULL, /* init */ + my_strnncoll_cp932_japanese_ci, + my_strnncollsp_cp932_japanese_nopad_ci, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb, + my_strcasecmp_8bit, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_handler_cp932_nopad_bin= +{ + NULL, /* init */ + my_strnncoll_cp932_bin, + my_strnncollsp_cp932_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - ismbchar_cp932, - mbcharlen_cp932, my_numchars_mb, my_charpos_mb, - my_well_formed_len_cp932, my_lengthsp_8bit, my_numcells_cp932, my_mb_wc_cp932, /* mb_wc */ @@ -34790,4 +34823,69 @@ struct charset_info_st my_charset_cp932_bin= &my_collation_handler_cp932_bin }; + +struct charset_info_st my_charset_cp932_japanese_nopad_ci= +{ + MY_NOPAD_ID(95),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NOPAD, /* state */ + "cp932", /* cs name */ + "cp932_japanese_nopad_ci",/* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp932, + to_lower_cp932, + to_upper_cp932, + sort_order_cp932, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_cp932, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFCFC, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_cp932_japanese_nopad_ci +}; + +struct charset_info_st my_charset_cp932_nopad_bin= +{ + MY_NOPAD_ID(96),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "cp932", /* cs name */ + "cp932_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp932, + to_lower_cp932, + to_upper_cp932, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_cp932, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFCFC, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_cp932_nopad_bin +}; + #endif diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 99673100c12..17c4c98c24e 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -276,9 +276,7 @@ static int my_strnncoll_czech(CHARSET_INFO *cs __attribute__((unused)), static int my_strnncollsp_czech(CHARSET_INFO * cs, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference - __attribute__((unused))) + const uchar *t, size_t tlen) { for ( ; slen && s[slen-1] == ' ' ; slen--); for ( ; tlen && t[tlen-1] == ' ' ; tlen--); diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 4c549a6686a..deb13957900 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -210,20 +210,6 @@ static const uchar sort_order_euc_kr[]= #include "ctype-mb.ic" -static uint ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return ((*(uchar*)(p)<0x80)? 0:\ - iseuc_kr_head(*(p)) && (e)-(p)>1 && iseuc_kr_tail(*((p)+1))? 2:\ - 0); -} - -static uint mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c) -{ - return (iseuc_kr_head(c) ? 2 : 1); -} - - static MY_UNICASE_CHARACTER cA3[256]= { {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */ @@ -9952,6 +9938,20 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_korean_nopad_ci +#define WEIGHT_MB1(x) (sort_order_euc_kr[(uchar) (x)]) +#define WEIGHT_MB2(x,y) (euckrcode(x, y)) +#include "strcoll.ic" + + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_nopad_bin +#define WEIGHT_MB1(x) ((uchar) (x)) +#define WEIGHT_MB2(x,y) (euckrcode(x, y)) +#include "strcoll.ic" + + static MY_COLLATION_HANDLER my_collation_handler_euckr_korean_ci= { NULL, /* init */ @@ -9984,14 +9984,43 @@ static MY_COLLATION_HANDLER my_collation_handler_euckr_bin= }; +static MY_COLLATION_HANDLER my_collation_handler_euckr_korean_nopad_ci= +{ + NULL, /* init */ + my_strnncoll_euckr_korean_ci, + my_strnncollsp_euckr_korean_nopad_ci, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb, + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_handler_euckr_nopad_bin= +{ + NULL, /* init */ + my_strnncoll_euckr_bin, + my_strnncollsp_euckr_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - ismbchar_euc_kr, - mbcharlen_euc_kr, my_numchars_mb, my_charpos_mb, - my_well_formed_len_euckr, my_lengthsp_8bit, my_numcells_8bit, my_mb_wc_euc_kr, /* mb_wc */ @@ -10085,4 +10114,70 @@ struct charset_info_st my_charset_euckr_bin= &my_collation_handler_euckr_bin }; + +struct charset_info_st my_charset_euckr_korean_nopad_ci= +{ + MY_NOPAD_ID(19),0,0,/* number */ + MY_CS_COMPILED|MY_CS_NOPAD, /* state */ + "euckr", /* cs name */ + "euckr_korean_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_euc_kr, + to_lower_euc_kr, + to_upper_euc_kr, + sort_order_euc_kr, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_euckr, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFEFE, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_euckr_korean_nopad_ci +}; + + +struct charset_info_st my_charset_euckr_nopad_bin= +{ + MY_NOPAD_ID(85),0,0,/* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "euckr", /* cs name */ + "euckr_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_euc_kr, + to_lower_euc_kr, + to_upper_euc_kr, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_euckr, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFEFE, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_euckr_nopad_bin +}; + #endif diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index fe699f8a334..118e8286703 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -199,6 +199,7 @@ static const uchar sort_order_eucjpms[]= #define IS_MB2_KATA(x,y) (iseucjpms_ss2(x) && iskata(y)) #define IS_MB2_CHAR(x,y) (IS_MB2_KATA(x,y) || IS_MB2_JIS(x,y)) #define IS_MB3_CHAR(x,y,z) (iseucjpms_ss3(x) && IS_MB2_JIS(y,z)) +#define IS_MB_PREFIX2(x,y) (iseucjpms_ss3(x) && iseucjpms(y)) #define DEFINE_ASIAN_ROUTINES #include "ctype-mb.ic" @@ -220,20 +221,24 @@ static const uchar sort_order_eucjpms[]= #include "strcoll.ic" -static uint ismbchar_eucjpms(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return ((*(uchar*)(p)<0x80)? 0:\ - iseucjpms(*(p)) && (e)-(p)>1 && iseucjpms(*((p)+1))? 2:\ - iseucjpms_ss2(*(p)) && (e)-(p)>1 && iskata(*((p)+1))? 2:\ - iseucjpms_ss3(*(p)) && (e)-(p)>2 && iseucjpms(*((p)+1)) && iseucjpms(*((p)+2))? 3:\ - 0); -} +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _eucjpms_japanese_nopad_ci +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(x) ((int) sort_order_eucjpms[(uchar) (x)]) +#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ + (((uint) (uchar) (y)) << 8)) +#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#include "strcoll.ic" -static uint mbcharlen_eucjpms(CHARSET_INFO *cs __attribute__((unused)),uint c) -{ - return (iseucjpms(c)? 2: iseucjpms_ss2(c)? 2: iseucjpms_ss3(c)? 3: 1); -} + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _eucjpms_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(x) ((int) (uchar) (x)) +#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ + (((uint) (uchar) (y)) << 8)) +#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#include "strcoll.ic" /* Case info pages for JIS-X-0208 range */ @@ -67517,14 +67522,43 @@ static MY_COLLATION_HANDLER my_collation_eucjpms_bin_handler = }; +static MY_COLLATION_HANDLER my_collation_eucjpms_japanese_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_eucjpms_japanese_ci, + my_strnncollsp_eucjpms_japanese_nopad_ci, + my_strnxfrm_mb_nopad, /* strnxfrm */ + my_strnxfrmlen_simple, + my_like_range_mb, /* like_range */ + my_wildcmp_mb, /* wildcmp */ + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_eucjpms_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_eucjpms_bin, + my_strnncollsp_eucjpms_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - ismbchar_eucjpms, - mbcharlen_eucjpms, my_numchars_mb, my_charpos_mb, - my_well_formed_len_eucjpms, my_lengthsp_8bit, my_numcells_eucjpms, my_mb_wc_eucjpms, /* mb_wc */ @@ -67620,4 +67654,70 @@ struct charset_info_st my_charset_eucjpms_bin= }; +struct charset_info_st my_charset_eucjpms_japanese_nopad_ci= +{ + MY_NOPAD_ID(97),0,0, /* number */ + MY_CS_COMPILED|MY_CS_NOPAD,/* state */ + "eucjpms", /* cs name */ + "eucjpms_japanese_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_eucjpms, + to_lower_eucjpms, + to_upper_eucjpms, + sort_order_eucjpms, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_eucjpms,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 2, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFEFE, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_eucjpms_japanese_nopad_ci_handler +}; + + +struct charset_info_st my_charset_eucjpms_nopad_bin= +{ + MY_NOPAD_ID(98),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "eucjpms", /* cs name */ + "eucjpms_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_eucjpms, + to_lower_eucjpms, + to_upper_eucjpms, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_eucjpms,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 2, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFEFE, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_eucjpms_nopad_bin_handler +}; + + #endif diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index 90c7ea15eba..6e241cae933 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -8,6 +8,7 @@ /* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright 2008-2016 MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -946,64 +947,6 @@ static const uint16 to_uni_ascii_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1251 -static const uchar ctype_cp1251_bulgarian_ci[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, -0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, -0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 -}; - -static const uchar to_lower_cp1251_bulgarian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1251_bulgarian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, -0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF -}; - static const uchar sort_order_cp1251_bulgarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -1023,41 +966,6 @@ static const uchar sort_order_cp1251_bulgarian_ci[] = { 0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B }; -static const uint16 to_uni_cp1251_bulgarian_ci[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, -0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, -0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, -0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, -0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, -0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, -0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, -0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, -0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, -0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, -0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, -0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, -0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, -0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, -0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F -}; - #endif #ifdef HAVE_CHARSET_latin1 @@ -1291,64 +1199,6 @@ static const uint16 to_uni_hebrew_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin7 -static const uchar ctype_latin7_estonian_cs[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10, -0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20, -0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_latin7_estonian_cs[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_latin7_estonian_cs[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - static const uchar sort_order_latin7_estonian_cs[] = { 0x00,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x2E,0x2F,0x30,0x31,0x32,0x0A,0x0B, 0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, @@ -1368,102 +1218,9 @@ static const uchar sort_order_latin7_estonian_cs[] = { 0xDC,0xC3,0xC5,0xC9,0xCB,0xF3,0xF7,0x65,0xED,0xBD,0xD9,0xEB,0xF9,0xE2,0xE4,0x53 }; -static const uint16 to_uni_latin7_estonian_cs[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7, -0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, -0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7, -0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, -0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, -0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, -0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, -0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, -0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, -0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, -0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, -0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019 -}; - #endif #ifdef HAVE_CHARSET_latin2 -static const uchar ctype_latin2_hungarian_ci[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01, -0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_latin2_hungarian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_latin2_hungarian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - static const uchar sort_order_latin2_hungarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -1483,41 +1240,6 @@ static const uchar sort_order_latin2_hungarian_ci[] = { 0xFF,0x62,0x63,0x64,0x66,0x67,0x67,0xFF,0x6D,0x77,0x75,0x78,0x78,0x7E,0x74,0xFF }; -static const uint16 to_uni_latin2_hungarian_ci[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, -0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, -0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, -0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; - #endif #ifdef HAVE_CHARSET_koi8u @@ -1636,64 +1358,6 @@ static const uint16 to_uni_koi8u_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1251 -static const uchar ctype_cp1251_ukrainian_ci[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, -0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, -0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 -}; - -static const uchar to_lower_cp1251_ukrainian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1251_ukrainian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, -0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF -}; - static const uchar sort_order_cp1251_ukrainian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -1713,41 +1377,6 @@ static const uchar sort_order_cp1251_ukrainian_ci[] = { 0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4 }; -static const uint16 to_uni_cp1251_ukrainian_ci[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, -0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, -0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, -0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, -0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, -0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, -0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, -0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, -0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, -0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, -0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, -0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, -0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, -0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, -0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F -}; - #endif #ifdef HAVE_CHARSET_greek @@ -1981,64 +1610,6 @@ static const uint16 to_uni_cp1250_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin2 -static const uchar ctype_latin2_croatian_ci[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01, -0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_latin2_croatian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_latin2_croatian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - static const uchar sort_order_latin2_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -2058,102 +1629,9 @@ static const uchar sort_order_latin2_croatian_ci[] = { 0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xFE,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF }; -static const uint16 to_uni_latin2_croatian_ci[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, -0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, -0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, -0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; - #endif #ifdef HAVE_CHARSET_cp1257 -static const uchar ctype_cp1257_lithuanian_ci[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 -}; - -static const uchar to_lower_cp1257_lithuanian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1257_lithuanian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - static const uchar sort_order_cp1257_lithuanian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -2173,41 +1651,6 @@ static const uchar sort_order_cp1257_lithuanian_ci[] = { 0x5A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0x5D,0xFF,0xFF,0xFF,0xFF }; -static const uint16 to_uni_cp1257_lithuanian_ci[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, -0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8, -0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000, -0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7, -0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, -0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, -0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, -0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, -0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, -0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, -0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, -0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, -0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9 -}; - #endif #ifdef HAVE_CHARSET_latin5 @@ -3131,64 +2574,6 @@ static const uint16 to_uni_latin7_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin7 -static const uchar ctype_latin7_general_cs[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10, -0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20, -0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_latin7_general_cs[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_latin7_general_cs[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - static const uchar sort_order_latin7_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -3208,198 +2593,12 @@ static const uchar sort_order_latin7_general_cs[] = { 0xE2,0xC5,0xC7,0xCB,0xCF,0xD1,0xCD,0x64,0xED,0xBD,0xDF,0xEB,0xE9,0xFB,0xFD,0x52 }; -static const uint16 to_uni_latin7_general_cs[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7, -0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, -0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7, -0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, -0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, -0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, -0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, -0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, -0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, -0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, -0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, -0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019 -}; - #endif #ifdef HAVE_CHARSET_macce -static const uchar ctype_macce_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x01,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x02,0x02,0x01,0x02,0x02,0x01, -0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02, -0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x01, -0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01, -0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x01,0x02,0x01, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x01,0x00,0x00,0x02,0x01, -0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x01, -0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x01,0x02,0x01,0x00 -}; - -static const uchar to_lower_macce_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x8A,0x82,0x82,0x8E,0x88,0x9A,0x9F,0x87,0x88,0x8B,0x8A,0x8B,0x8D,0x8D,0x8E,0x90, -0x90,0x93,0x92,0x93,0x95,0x95,0x98,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9E,0x9E,0x9F, -0xA0,0xA1,0xAB,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xB0, -0xB0,0xB4,0xB2,0xB3,0xB4,0xFA,0xB6,0xB7,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE,0xC0, -0xC0,0xC4,0xC2,0xC3,0xC4,0xCB,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCE,0x9B,0xCE,0xD8, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xDA,0xDA,0xDE,0xDC,0xDD,0xDE,0xE0, -0xE0,0xE4,0xE2,0xE3,0xE4,0xE6,0xE6,0x87,0xE9,0xE9,0x92,0xEC,0xEC,0xF0,0x97,0x99, -0xF0,0xF3,0x9C,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFA,0xFD,0xB8,0xFD,0xAE,0xFF -}; - -static const uchar to_upper_macce_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x81,0x83,0x84,0x85,0x86,0xE7,0x84,0x89,0x80,0x89,0x8C,0x8C,0x83,0x8F, -0x8F,0x91,0xEA,0x91,0x94,0x94,0x96,0xEE,0x96,0xEF,0x85,0xCD,0xF2,0x9D,0x9D,0x86, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xA2,0xAC,0xAD,0xFE,0xAF, -0xAF,0xB1,0xB2,0xB3,0xB1,0xB5,0xB6,0xB7,0xFC,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF, -0xBF,0xC1,0xC2,0xC3,0xC1,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xC5,0xCC,0xCD,0xCC,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xCF,0xD9,0xD9,0xDB,0xDC,0xDD,0xDB,0xDF, -0xDF,0xE1,0xE2,0xE3,0xE1,0xE5,0xE5,0xE7,0xE8,0xE8,0xEA,0xEB,0xEB,0xED,0xEE,0xEF, -0xED,0xF1,0xF2,0xF1,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xB5,0xFB,0xFC,0xFB,0xFE,0xFF -}; - -static const uint16 to_uni_macce_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x00C4,0x0100,0x0101,0x00C9,0x0104,0x00D6,0x00DC,0x00E1, -0x0105,0x010C,0x00E4,0x010D,0x0106,0x0107,0x00E9,0x0179, -0x017A,0x010E,0x00ED,0x010F,0x0112,0x0113,0x0116,0x00F3, -0x0117,0x00F4,0x00F6,0x00F5,0x00FA,0x011A,0x011B,0x00FC, -0x2020,0x00B0,0x0118,0x00A3,0x00A7,0x2022,0x00B6,0x00DF, -0x00AE,0x00A9,0x2122,0x0119,0x00A8,0x2260,0x0123,0x012E, -0x012F,0x012A,0x2264,0x2265,0x012B,0x0136,0x2202,0x2211, -0x0142,0x013B,0x013C,0x013D,0x013E,0x0139,0x013A,0x0145, -0x0146,0x0143,0x00AC,0x221A,0x0144,0x0147,0x2206,0x00AB, -0x00BB,0x2026,0x00A0,0x0148,0x0150,0x00D5,0x0151,0x014C, -0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA, -0x014D,0x0154,0x0155,0x0158,0x2039,0x203A,0x0159,0x0156, -0x0157,0x0160,0x201A,0x201E,0x0161,0x015A,0x015B,0x00C1, -0x0164,0x0165,0x00CD,0x017D,0x017E,0x016A,0x00D3,0x00D4, -0x016B,0x016E,0x00DA,0x016F,0x0170,0x0171,0x0172,0x0173, -0x00DD,0x00FD,0x0137,0x017B,0x0141,0x017C,0x0122,0x02C7 -}; - #endif #ifdef HAVE_CHARSET_cp1250 -static const uchar ctype_cp1250_croatian_ci[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01, -0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02, -0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, -0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_cp1250_croatian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xB3,0xA4,0xB9,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBE,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1250_croatian_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - static const uchar sort_order_cp1250_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -3419,41 +2618,6 @@ static const uchar sort_order_cp1250_croatian_ci[] = { 0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF }; -static const uint16 to_uni_cp1250_croatian_ci[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, -0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, -0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, -0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, -0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, -0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; - #endif #ifdef HAVE_CHARSET_latin1 @@ -3687,99 +2851,6 @@ static const uint16 to_uni_latin1_general_cs[] = { #endif #ifdef HAVE_CHARSET_cp1251 -static const uchar ctype_cp1251_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, -0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, -0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 -}; - -static const uchar to_lower_cp1251_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1251_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, -0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF -}; - -static const uint16 to_uni_cp1251_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, -0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, -0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, -0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, -0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, -0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, -0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, -0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, -0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, -0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, -0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, -0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, -0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, -0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, -0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F -}; - #endif #ifdef HAVE_CHARSET_cp1251 @@ -3898,64 +2969,6 @@ static const uint16 to_uni_cp1251_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1251 -static const uchar ctype_cp1251_general_cs[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, -0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, -0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 -}; - -static const uchar to_lower_cp1251_general_cs[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1251_general_cs[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, -0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF -}; - static const uchar sort_order_cp1251_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -3975,137 +2988,9 @@ static const uchar sort_order_cp1251_general_cs[] = { 0xAE,0xB0,0xB2,0xB6,0xBA,0xBC,0xBE,0xC0,0xC4,0xC6,0xC8,0xCA,0xCC,0xCE,0xD0,0xD2 }; -static const uint16 to_uni_cp1251_general_cs[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, -0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, -0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, -0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, -0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, -0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, -0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, -0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, -0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, -0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, -0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, -0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, -0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, -0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, -0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F -}; - #endif #ifdef HAVE_CHARSET_macroman -static const uchar ctype_macroman_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x10, -0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, -0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x00,0x01,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static const uchar to_lower_macroman_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x8A,0x8C,0x8D,0x8E,0x96,0x9A,0x9F,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xBE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0x88,0x8B,0x9B,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD8,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0x89,0x90,0x87,0x91,0x8F,0x92,0x94,0x95,0x93,0x97,0x99, -0xF0,0x98,0x9C,0x9E,0x9D,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_macroman_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0xE7,0xCB,0xE5,0x80,0xCC,0x81,0x82,0x83,0xE9, -0xE6,0xE8,0xEA,0xED,0xEB,0xEC,0x84,0xEE,0xF1,0xEF,0x85,0xCD,0xF2,0xF4,0xF3,0x86, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xAE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD9,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_macroman_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1, -0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8, -0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3, -0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC, -0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF, -0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8, -0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211, -0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8, -0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB, -0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153, -0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA, -0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02, -0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1, -0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4, -0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC, -0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7 -}; - #endif #ifdef HAVE_CHARSET_cp1256 @@ -4224,99 +3109,6 @@ static const uint16 to_uni_cp1256_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1257 -static const uchar ctype_cp1257_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 -}; - -static const uchar to_lower_cp1257_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1257_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - -static const uint16 to_uni_cp1257_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, -0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8, -0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000, -0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7, -0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, -0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, -0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, -0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, -0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, -0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, -0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, -0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, -0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9 -}; - #endif #ifdef HAVE_CHARSET_cp1257 @@ -4435,1731 +3227,57 @@ static const uint16 to_uni_cp1257_general_ci[] = { #endif #ifdef HAVE_CHARSET_armscii8 -static const uchar ctype_armscii8_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, -0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, -0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, -0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, -0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x10,0x10 -}; - -static const uchar to_lower_armscii8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB3,0xB3,0xB5,0xB5,0xB7,0xB7,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF,0xBF, -0xC1,0xC1,0xC3,0xC3,0xC5,0xC5,0xC7,0xC7,0xC9,0xC9,0xCB,0xCB,0xCD,0xCD,0xCF,0xCF, -0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xD9,0xD9,0xDB,0xDB,0xDD,0xDD,0xDF,0xDF, -0xE1,0xE1,0xE3,0xE3,0xE5,0xE5,0xE7,0xE7,0xE9,0xE9,0xEB,0xEB,0xED,0xED,0xEF,0xEF, -0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFB,0xFB,0xFD,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_armscii8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB2,0xB4,0xB4,0xB6,0xB6,0xB8,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE, -0xC0,0xC0,0xC2,0xC2,0xC4,0xC4,0xC6,0xC6,0xC8,0xC8,0xCA,0xCA,0xCC,0xCC,0xCE,0xCE, -0xD0,0xD0,0xD2,0xD2,0xD4,0xD4,0xD6,0xD6,0xD8,0xD8,0xDA,0xDA,0xDC,0xDC,0xDE,0xDE, -0xE0,0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE, -0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF -}; - -static const uint16 to_uni_armscii8_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x2741,0x00A7,0x0589,0x0029,0x0028,0x00BB,0x00AB, -0x2014,0x002E,0x055D,0x002C,0x002D,0x055F,0x2026,0x055C, -0x055B,0x055E,0x0531,0x0561,0x0532,0x0562,0x0533,0x0563, -0x0534,0x0564,0x0535,0x0565,0x0536,0x0566,0x0537,0x0567, -0x0538,0x0568,0x0539,0x0569,0x053A,0x056A,0x053B,0x056B, -0x053C,0x056C,0x053D,0x056D,0x053E,0x056E,0x053F,0x056F, -0x0540,0x0570,0x0541,0x0571,0x0542,0x0572,0x0543,0x0573, -0x0544,0x0574,0x0545,0x0575,0x0546,0x0576,0x0547,0x0577, -0x0548,0x0578,0x0549,0x0579,0x054A,0x057A,0x054B,0x057B, -0x054C,0x057C,0x054D,0x057D,0x054E,0x057E,0x054F,0x057F, -0x0550,0x0580,0x0551,0x0581,0x0552,0x0582,0x0553,0x0583, -0x0554,0x0584,0x0555,0x0585,0x0556,0x0586,0x2019,0x0027 -}; - #endif #ifdef HAVE_CHARSET_ascii -static const uchar ctype_ascii_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static const uchar to_lower_ascii_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_ascii_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_ascii_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; - #endif #ifdef HAVE_CHARSET_cp1250 -static const uchar ctype_cp1250_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01, -0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02, -0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, -0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_cp1250_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xB3,0xA4,0xB9,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBE,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1250_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - -static const uint16 to_uni_cp1250_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, -0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, -0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, -0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, -0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, -0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; - #endif #ifdef HAVE_CHARSET_cp1256 -static const uchar ctype_cp1256_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x00,0x00, -0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x00, -0x03,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, -0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x00,0x00, -0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x10, -0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, -0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, -0x02,0x03,0x02,0x03,0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02, -0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x00,0x03,0x02,0x03,0x02,0x02,0x00,0x00,0x00 -}; - -static const uchar to_lower_cp1256_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x9C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1256_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5F,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7F,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_cp1256_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC,0x067E,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, -0x02C6,0x2030,0x0000,0x2039,0x0152,0x0686,0x0698,0x0000, -0x06AF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0000,0x203A,0x0153,0x200C,0x200D,0x0000, -0x00A0,0x060C,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x061B,0x00BB,0x00BC,0x00BD,0x00BE,0x061F, -0x0000,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627, -0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F, -0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x00D7, -0x0637,0x0638,0x0639,0x063A,0x0640,0x0641,0x0642,0x0643, -0x00E0,0x0644,0x00E2,0x0645,0x0646,0x0647,0x0648,0x00E7, -0x00E8,0x00E9,0x00EA,0x00EB,0x0649,0x064A,0x00EE,0x00EF, -0x064B,0x064C,0x064D,0x064E,0x00F4,0x064F,0x0650,0x00F7, -0x0651,0x00F9,0x0652,0x00FB,0x00FC,0x200E,0x200F,0x0000 -}; - #endif #ifdef HAVE_CHARSET_cp866 -static const uchar ctype_cp866_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 -}; - -static const uchar to_lower_cp866_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp866_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_cp866_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, -0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, -0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, -0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, -0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, -0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, -0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556, -0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510, -0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F, -0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567, -0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B, -0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580, -0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, -0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F, -0x0401,0x0451,0x0404,0x0454,0x0407,0x0457,0x040E,0x045E, -0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 -}; - #endif #ifdef HAVE_CHARSET_dec8 -static const uchar ctype_dec8_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 -}; - -static const uchar to_lower_dec8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_dec8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - -static const uint16 to_uni_dec8_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x00A1,0x00A2,0x00A3,0x0000,0x00A5,0x0000,0x00A7, -0x00A4,0x00A9,0x00AA,0x00AB,0x0000,0x0000,0x0000,0x0000, -0x00B0,0x00B1,0x00B2,0x00B3,0x0000,0x00B5,0x00B6,0x00B7, -0x0000,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x0000,0x00BF, -0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, -0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, -0x0000,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x0152, -0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0178,0x0000,0x00DF, -0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, -0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, -0x0000,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x0153, -0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FF,0x0000,0x0000 -}; - #endif #ifdef HAVE_CHARSET_greek -static const uchar ctype_greek_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x00,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x01,0x01,0x10,0x01,0x10,0x01,0x01, -0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 -}; - -static const uchar to_lower_greek_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xDC,0xB7,0xDD,0xDE,0xDF,0xBB,0xFC,0xBD,0xFD,0xFE, -0xC0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xD2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_greek_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xDA,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xC1,0xC5,0xC7,0xC9, -0xDB,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xCF,0xD5,0xD9,0xFF -}; - -static const uint16 to_uni_greek_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x02BD,0x02BC,0x00A3,0x0000,0x0000,0x00A6,0x00A7, -0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x0000,0x2015, -0x00B0,0x00B1,0x00B2,0x00B3,0x0384,0x0385,0x0386,0x00B7, -0x0388,0x0389,0x038A,0x00BB,0x038C,0x00BD,0x038E,0x038F, -0x0390,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, -0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, -0x03A0,0x03A1,0x0000,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7, -0x03A8,0x03A9,0x03AA,0x03AB,0x03AC,0x03AD,0x03AE,0x03AF, -0x03B0,0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7, -0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF, -0x03C0,0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7, -0x03C8,0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0x0000 -}; - #endif #ifdef HAVE_CHARSET_hebrew -static const uchar ctype_hebrew_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x20,0x20,0x00 -}; - -static const uchar to_lower_hebrew_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_hebrew_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_hebrew_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x00D7,0x00AB,0x00AC,0x00AD,0x00AE,0x203E, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x00F7,0x00BB,0x00BC,0x00BD,0x00BE,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2017, -0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7, -0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF, -0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7, -0x05E8,0x05E9,0x05EA,0x0000,0x0000,0x200E,0x200F,0x0000 -}; - #endif #ifdef HAVE_CHARSET_hp8 -static const uchar ctype_hp8_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x02, -0x01,0x10,0x10,0x01,0x02,0x10,0x10,0x02,0x01,0x10,0x01,0x01,0x01,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 -}; - -static const uchar to_lower_hp8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xC8,0xC0,0xC9,0xC1,0xCD,0xD1,0xDD,0xA8,0xA9,0xAA,0xAB,0xAC,0xCB,0xC3,0xAF, -0xB0,0xB2,0xB2,0xB3,0xB5,0xB5,0xB7,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD4,0xD1,0xD6,0xD7,0xD4,0xD5,0xD6,0xD7,0xCC,0xD9,0xCE,0xCF,0xC5,0xDD,0xDE,0xC2, -0xC4,0xE2,0xE2,0xE4,0xE4,0xD5,0xD9,0xC6,0xCA,0xEA,0xEA,0xEC,0xEC,0xC7,0xEF,0xEF, -0xF1,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_hp8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB1,0xB3,0xB4,0xB4,0xB6,0xB6,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xA2,0xA4,0xDF,0xAE,0xE0,0xDC,0xE7,0xED,0xA1,0xA3,0xE8,0xAD,0xD8,0xA5,0xDA,0xDB, -0xD0,0xA6,0xD2,0xD3,0xD0,0xE5,0xD2,0xD3,0xD8,0xE6,0xDA,0xDB,0xDC,0xA7,0xDE,0xDF, -0xE0,0xE1,0xE1,0xE3,0xE3,0xE5,0xE6,0xE7,0xE8,0xE9,0xE9,0xEB,0xEB,0xED,0xEE,0xEE, -0xF0,0xF0,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_hp8_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x00C0,0x00C2,0x00C8,0x00CA,0x00CB,0x00CE,0x00CF, -0x00B4,0x02CB,0x02C6,0x00A8,0x02DC,0x00D9,0x00DB,0x20A4, -0x00AF,0x00DD,0x00FD,0x00B0,0x00C7,0x00E7,0x00D1,0x00F1, -0x00A1,0x00BF,0x00A4,0x00A3,0x00A5,0x00A7,0x0192,0x00A2, -0x00E2,0x00EA,0x00F4,0x00FB,0x00E1,0x00E9,0x00F3,0x00FA, -0x00E0,0x00E8,0x00F2,0x00F9,0x00E4,0x00EB,0x00F6,0x00FC, -0x00C5,0x00EE,0x00D8,0x00C6,0x00E5,0x00ED,0x00F8,0x00E6, -0x00C4,0x00EC,0x00D6,0x00DC,0x00C9,0x00EF,0x00DF,0x00D4, -0x00C1,0x00C3,0x00E3,0x00D0,0x00F0,0x00CD,0x00CC,0x00D3, -0x00D2,0x00D5,0x00F5,0x0160,0x0161,0x00DA,0x0178,0x00FF, -0x00DE,0x00FE,0x00B7,0x00B5,0x00B6,0x00BE,0x2014,0x00BC, -0x00BD,0x00AA,0x00BA,0x00AB,0x25A0,0x00BB,0x00B1,0x0000 -}; - #endif #ifdef HAVE_CHARSET_keybcs2 -static const uchar ctype_keybcs2_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x02,0x82,0x02,0x02,0x01,0x01,0x02,0x82,0x81,0x01,0x01,0x02,0x02,0x01,0x01, -0x81,0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x02,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x01,0x02,0x00,0x02,0x02,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 -}; - -static const uchar to_lower_keybcs2_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x87,0x81,0x82,0x83,0x84,0x83,0x86,0x87,0x88,0x88,0x8D,0xA1,0x8C,0x8D,0x84,0xA0, -0x82,0x91,0x91,0x93,0x94,0xA2,0x96,0xA3,0x98,0x94,0x81,0x9B,0x8C,0x98,0xA9,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0x96,0x93,0x9B,0xA9,0xAA,0xAA,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xED,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_keybcs2_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x68,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x87,0x9A,0x90,0x85,0x8E,0x85,0x86,0x80,0x89,0x89,0x8A,0x8B,0x9C,0x8A,0x8E,0x8F, -0x90,0x92,0x92,0xA7,0x99,0x95,0xA6,0x97,0x9D,0x99,0x9A,0xA8,0x9C,0x9D,0x9E,0x9F, -0x8F,0x8B,0x95,0x97,0xA5,0xA5,0xA6,0xA7,0xA8,0x9E,0xAB,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xE8,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_keybcs2_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x010C,0x00FC,0x00E9,0x010F,0x00E4,0x010E,0x0164,0x010D, -0x011B,0x011A,0x0139,0x00CD,0x013E,0x013A,0x00C4,0x00C1, -0x00C9,0x017E,0x017D,0x00F4,0x00F6,0x00D3,0x016F,0x00DA, -0x00FD,0x00D6,0x00DC,0x0160,0x013D,0x00DD,0x0158,0x0165, -0x00E1,0x00ED,0x00F3,0x00FA,0x0148,0x0147,0x016E,0x00D4, -0x0161,0x0159,0x0155,0x0154,0x00BC,0x00A1,0x00AB,0x00BB, -0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556, -0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510, -0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F, -0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567, -0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B, -0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580, -0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4, -0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229, -0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248, -0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 -}; - #endif #ifdef HAVE_CHARSET_koi8r -static const uchar ctype_koi8r_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 -}; - -static const uchar to_lower_koi8r_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF -}; - -static const uchar to_upper_koi8r_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xB3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_koi8r_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, -0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, -0x2591,0x2592,0x2593,0x2320,0x25A0,0x2219,0x221A,0x2248, -0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, -0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556, -0x2557,0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E, -0x255F,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565, -0x2566,0x2567,0x2568,0x2569,0x256A,0x256B,0x256C,0x00A9, -0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, -0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, -0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, -0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, -0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, -0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, -0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, -0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A -}; - #endif #ifdef HAVE_CHARSET_koi8u -static const uchar ctype_koi8u_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x02,0x02,0x10,0x02,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10, -0x10,0x10,0x10,0x01,0x01,0x10,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x10, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 -}; - -static const uchar to_lower_koi8u_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x20,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20, -0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF -}; - -static const uchar to_upper_koi8u_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20, -0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_koi8u_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, -0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, -0x2591,0x2592,0x2593,0x2320,0x25A0,0x2022,0x221A,0x2248, -0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, -0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457, -0x2557,0x2558,0x2559,0x255A,0x255B,0x0491,0x255D,0x255E, -0x255F,0x2560,0x2561,0x0401,0x0404,0x2563,0x0406,0x0407, -0x2566,0x2567,0x2568,0x2569,0x256A,0x0490,0x256C,0x00A9, -0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, -0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, -0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, -0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, -0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, -0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, -0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, -0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A -}; - #endif #ifdef HAVE_CHARSET_latin2 -static const uchar ctype_latin2_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01, -0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_latin2_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_latin2_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - -static const uint16 to_uni_latin2_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, -0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, -0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, -0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; - #endif #ifdef HAVE_CHARSET_latin5 -static const uchar ctype_latin5_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 -}; - -static const uchar to_lower_latin5_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0xFD,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0x69,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_latin5_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0xDD,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0x49,0xDE,0xFF -}; - -static const uint16 to_uni_latin5_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, -0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, -0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, -0x011E,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, -0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0130,0x015E,0x00DF, -0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, -0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, -0x011F,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, -0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x0131,0x015F,0x00FF -}; - #endif #ifdef HAVE_CHARSET_latin7 -static const uchar ctype_latin7_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10, -0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20, -0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_latin7_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_latin7_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - -static const uint16 to_uni_latin7_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7, -0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, -0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7, -0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, -0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, -0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, -0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, -0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, -0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, -0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, -0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, -0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019 -}; - #endif #ifdef HAVE_CHARSET_cp850 -static const uchar ctype_cp850_bin[] = { -0x00, -0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x30,0x30, -0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x30,0x30,0x30,0x30,0x30, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x30, -0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, -0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x10,0x01,0x10,0x10, -0x02,0x02,0x02,0x02,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10, -0x01,0x02,0x01,0x01,0x02,0x01,0x10,0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x10,0x10, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 -}; - -static const uchar to_lower_cp850_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x84,0x86, -0x82,0x91,0x91,0x93,0x94,0x95,0x96,0x97,0x98,0x94,0x81,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp850_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F, -0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_cp850_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7, -0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5, -0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9, -0x00FF,0x00D6,0x00DC,0x00F8,0x00A3,0x00D8,0x00D7,0x0192, -0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA, -0x00BF,0x00AE,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB, -0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x00C0, -0x00A9,0x2563,0x2551,0x2557,0x255D,0x00A2,0x00A5,0x2510, -0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x00E3,0x00C3, -0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4, -0x00F0,0x00D0,0x00CA,0x00CB,0x00C8,0x0131,0x00CD,0x00CE, -0x00CF,0x2518,0x250C,0x2588,0x2584,0x00A6,0x00CC,0x2580, -0x00D3,0x00DF,0x00D4,0x00D2,0x00F5,0x00D5,0x00B5,0x00FE, -0x00DE,0x00DA,0x00DB,0x00D9,0x00FD,0x00DD,0x00AF,0x00B4, -0x00AD,0x00B1,0x2017,0x00BE,0x00B6,0x00A7,0x00F7,0x00B8, -0x00B0,0x00A8,0x00B7,0x00B9,0x00B3,0x00B2,0x25A0,0x00A0 -}; - #endif #ifdef HAVE_CHARSET_cp852 -static const uchar ctype_cp852_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, -0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02,0x01,0x01,0x01, -0x01,0x01,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x02,0x01,0x00,0x02, -0x02,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x02,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x02,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x01,0x00, -0x01,0x02,0x01,0x01,0x02,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x00,0x48 -}; - -static const uchar to_lower_cp852_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8B,0x8B,0x8C,0xAB,0x84,0x86, -0x82,0x92,0x92,0x93,0x94,0x96,0x96,0x98,0x98,0x94,0x81,0x9C,0x9C,0x88,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAA,0xAB,0x9F,0xB8,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xA0,0x83,0xD8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD0,0xD4,0x89,0xD4,0xE5,0xA1,0x8C,0xD8,0xD9,0xDA,0xDB,0xDC,0xEE,0x85,0xDF, -0xA2,0xE1,0x93,0xE4,0xE4,0xE5,0xE7,0xE7,0xEA,0xA3,0xE8,0xFB,0xEC,0xEC,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp852_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F, -0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0xAC, -0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xAD,0xB9,0xBA,0xBB,0xBC,0xBE,0xBD,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF -}; - -static const uint16 to_uni_cp852_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x016F,0x0107,0x00E7, -0x0142,0x00EB,0x0150,0x0151,0x00EE,0x0179,0x00C4,0x0106, -0x00C9,0x0139,0x013A,0x00F4,0x00F6,0x013D,0x013E,0x015A, -0x015B,0x00D6,0x00DC,0x0164,0x0165,0x0141,0x00D7,0x010D, -0x00E1,0x00ED,0x00F3,0x00FA,0x0104,0x0105,0x017D,0x017E, -0x0118,0x0119,0x00AC,0x017A,0x010C,0x015F,0x00AB,0x00BB, -0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x011A, -0x015E,0x2563,0x2551,0x2557,0x255D,0x017B,0x017C,0x2510, -0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x0102,0x0103, -0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4, -0x0111,0x0110,0x010E,0x00CB,0x010F,0x0147,0x00CD,0x00CE, -0x011B,0x2518,0x250C,0x2588,0x2584,0x0162,0x016E,0x2580, -0x00D3,0x00DF,0x00D4,0x0143,0x0144,0x0148,0x0160,0x0161, -0x0154,0x00DA,0x0155,0x0170,0x00FD,0x00DD,0x0163,0x00B4, -0x00AD,0x02DD,0x02DB,0x02C7,0x02D8,0x00A7,0x00F7,0x00B8, -0x00B0,0x00A8,0x02D9,0x0171,0x0158,0x0159,0x25A0,0x00A0 -}; - #endif #ifdef HAVE_CHARSET_swe7 -static const uchar ctype_swe7_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x01,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, -0x01,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x20, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static const uchar to_lower_swe7_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_swe7_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_swe7_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x00C9,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x00C4,0x00D6,0x00C5,0x00DC,0x005F, -0x00E9,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x00E4,0x00F6,0x00E5,0x00FC,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; - #endif #ifdef HAVE_CHARSET_geostd8 @@ -6278,99 +3396,6 @@ static const uint16 to_uni_geostd8_general_ci[] = { #endif #ifdef HAVE_CHARSET_geostd8 -static const uchar ctype_geostd8_bin[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x00,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x10,0x00,0x00,0x00,0x00, -0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00, -0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, -0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, -0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static const uchar to_lower_geostd8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_geostd8_bin[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uint16 to_uni_geostd8_bin[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, -0x0000,0x2030,0x0000,0x2039,0x0000,0x0000,0x0000,0x0000, -0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x0000,0x0000,0x203A,0x0000,0x0000,0x0000,0x0000, -0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, -0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10F1, -0x10D7,0x10D8,0x10D9,0x10DA,0x10DB,0x10DC,0x10F2,0x10DD, -0x10DE,0x10DF,0x10E0,0x10E1,0x10E2,0x10F3,0x10E3,0x10E4, -0x10E5,0x10E6,0x10E7,0x10E8,0x10E9,0x10EA,0x10EB,0x10EC, -0x10ED,0x10EE,0x10F4,0x10EF,0x10F0,0x10F5,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, -0x0000,0x0000,0x0000,0x0000,0x0000,0x2116,0x0000,0x0000 -}; - #endif #ifdef HAVE_CHARSET_latin1 @@ -6489,64 +3514,6 @@ static const uint16 to_uni_latin1_spanish_ci[] = { #endif #ifdef HAVE_CHARSET_cp1250 -static const uchar ctype_cp1250_polish_ci[] = { -0x00, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, -0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, -0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, -0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01, -0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02, -0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, -0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 -}; - -static const uchar to_lower_cp1250_polish_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0xA1,0xA2,0xB3,0xA4,0xB9,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBE,0xBD,0xBE,0xBF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF -}; - -static const uchar to_upper_cp1250_polish_ci[] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF -}; - static const uchar sort_order_cp1250_polish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, @@ -6566,41 +3533,144 @@ static const uchar sort_order_cp1250_polish_ci[] = { 0x48,0x58,0x57,0x5A,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF }; -static const uint16 to_uni_cp1250_polish_ci[] = { -0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, -0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, -0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, -0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, -0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, -0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, -0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; +#endif + +#ifdef HAVE_CHARSET_dec8 +#endif +#ifdef HAVE_CHARSET_cp850 +#endif + +#ifdef HAVE_CHARSET_hp8 +#endif + +#ifdef HAVE_CHARSET_koi8r +#endif + +#ifdef HAVE_CHARSET_latin2 +#endif + +#ifdef HAVE_CHARSET_swe7 +#endif + +#ifdef HAVE_CHARSET_ascii +#endif + +#ifdef HAVE_CHARSET_hebrew +#endif + +#ifdef HAVE_CHARSET_koi8u +#endif + +#ifdef HAVE_CHARSET_greek +#endif + +#ifdef HAVE_CHARSET_cp1250 +#endif + +#ifdef HAVE_CHARSET_latin5 +#endif + +#ifdef HAVE_CHARSET_armscii8 +#endif + +#ifdef HAVE_CHARSET_cp866 +#endif + +#ifdef HAVE_CHARSET_keybcs2 +#endif + +#ifdef HAVE_CHARSET_macce +#endif + +#ifdef HAVE_CHARSET_macroman +#endif + +#ifdef HAVE_CHARSET_cp852 +#endif + +#ifdef HAVE_CHARSET_latin7 +#endif + +#ifdef HAVE_CHARSET_macce +#endif + +#ifdef HAVE_CHARSET_cp1251 +#endif + +#ifdef HAVE_CHARSET_cp1251 +#endif + +#ifdef HAVE_CHARSET_macroman +#endif + +#ifdef HAVE_CHARSET_cp1256 +#endif + +#ifdef HAVE_CHARSET_cp1257 +#endif + +#ifdef HAVE_CHARSET_cp1257 +#endif + +#ifdef HAVE_CHARSET_armscii8 +#endif + +#ifdef HAVE_CHARSET_ascii +#endif + +#ifdef HAVE_CHARSET_cp1250 +#endif + +#ifdef HAVE_CHARSET_cp1256 +#endif + +#ifdef HAVE_CHARSET_cp866 +#endif + +#ifdef HAVE_CHARSET_dec8 +#endif + +#ifdef HAVE_CHARSET_greek +#endif + +#ifdef HAVE_CHARSET_hebrew +#endif + +#ifdef HAVE_CHARSET_hp8 +#endif + +#ifdef HAVE_CHARSET_keybcs2 +#endif + +#ifdef HAVE_CHARSET_koi8r +#endif + +#ifdef HAVE_CHARSET_koi8u +#endif + +#ifdef HAVE_CHARSET_latin2 +#endif + +#ifdef HAVE_CHARSET_latin5 +#endif + +#ifdef HAVE_CHARSET_latin7 +#endif + +#ifdef HAVE_CHARSET_cp850 +#endif + +#ifdef HAVE_CHARSET_cp852 +#endif + +#ifdef HAVE_CHARSET_swe7 +#endif + +#ifdef HAVE_CHARSET_geostd8 +#endif + +#ifdef HAVE_CHARSET_geostd8 #endif struct charset_info_st compiled_charsets[] = { @@ -6613,11 +3683,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_dec8_swedish_ci, /* ctype */ - to_lower_dec8_swedish_ci, /* lower */ - to_upper_dec8_swedish_ci, /* upper */ + to_lower_dec8_swedish_ci, /* to_lower */ + to_upper_dec8_swedish_ci, /* to_upper */ sort_order_dec8_swedish_ci, /* sort_order */ NULL, /* uca */ - to_uni_dec8_swedish_ci, /* to_uni */ + to_uni_dec8_swedish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6646,11 +3716,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_cp850_general_ci, /* ctype */ - to_lower_cp850_general_ci, /* lower */ - to_upper_cp850_general_ci, /* upper */ + to_lower_cp850_general_ci, /* to_lower */ + to_upper_cp850_general_ci, /* to_upper */ sort_order_cp850_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp850_general_ci, /* to_uni */ + to_uni_cp850_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6679,11 +3749,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin1_german1_ci, /* ctype */ - to_lower_latin1_german1_ci, /* lower */ - to_upper_latin1_german1_ci, /* upper */ + to_lower_latin1_german1_ci, /* to_lower */ + to_upper_latin1_german1_ci, /* to_upper */ sort_order_latin1_german1_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin1_german1_ci, /* to_uni */ + to_uni_latin1_german1_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6712,11 +3782,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_hp8_english_ci, /* ctype */ - to_lower_hp8_english_ci, /* lower */ - to_upper_hp8_english_ci, /* upper */ + to_lower_hp8_english_ci, /* to_lower */ + to_upper_hp8_english_ci, /* to_upper */ sort_order_hp8_english_ci, /* sort_order */ NULL, /* uca */ - to_uni_hp8_english_ci, /* to_uni */ + to_uni_hp8_english_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6745,11 +3815,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_koi8r_general_ci, /* ctype */ - to_lower_koi8r_general_ci, /* lower */ - to_upper_koi8r_general_ci, /* upper */ + to_lower_koi8r_general_ci, /* to_lower */ + to_upper_koi8r_general_ci, /* to_upper */ sort_order_koi8r_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_koi8r_general_ci, /* to_uni */ + to_uni_koi8r_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6778,11 +3848,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin2_general_ci, /* ctype */ - to_lower_latin2_general_ci, /* lower */ - to_upper_latin2_general_ci, /* upper */ + to_lower_latin2_general_ci, /* to_lower */ + to_upper_latin2_general_ci, /* to_upper */ sort_order_latin2_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin2_general_ci, /* to_uni */ + to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6811,11 +3881,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_swe7_swedish_ci, /* ctype */ - to_lower_swe7_swedish_ci, /* lower */ - to_upper_swe7_swedish_ci, /* upper */ + to_lower_swe7_swedish_ci, /* to_lower */ + to_upper_swe7_swedish_ci, /* to_upper */ sort_order_swe7_swedish_ci, /* sort_order */ NULL, /* uca */ - to_uni_swe7_swedish_ci, /* to_uni */ + to_uni_swe7_swedish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6844,11 +3914,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_ascii_general_ci, /* ctype */ - to_lower_ascii_general_ci, /* lower */ - to_upper_ascii_general_ci, /* upper */ + to_lower_ascii_general_ci, /* to_lower */ + to_upper_ascii_general_ci, /* to_upper */ sort_order_ascii_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_ascii_general_ci, /* to_uni */ + to_uni_ascii_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6876,12 +3946,12 @@ struct charset_info_st compiled_charsets[] = { "cp1251_bulgarian_ci", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1251_bulgarian_ci, /* ctype */ - to_lower_cp1251_bulgarian_ci, /* lower */ - to_upper_cp1251_bulgarian_ci, /* upper */ + ctype_cp1251_general_ci, /* ctype */ + to_lower_cp1251_general_ci, /* to_lower */ + to_upper_cp1251_general_ci, /* to_upper */ sort_order_cp1251_bulgarian_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1251_bulgarian_ci, /* to_uni */ + to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6910,11 +3980,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin1_danish_ci, /* ctype */ - to_lower_latin1_danish_ci, /* lower */ - to_upper_latin1_danish_ci, /* upper */ + to_lower_latin1_danish_ci, /* to_lower */ + to_upper_latin1_danish_ci, /* to_upper */ sort_order_latin1_danish_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin1_danish_ci, /* to_uni */ + to_uni_latin1_danish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6943,11 +4013,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_hebrew_general_ci, /* ctype */ - to_lower_hebrew_general_ci, /* lower */ - to_upper_hebrew_general_ci, /* upper */ + to_lower_hebrew_general_ci, /* to_lower */ + to_upper_hebrew_general_ci, /* to_upper */ sort_order_hebrew_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_hebrew_general_ci, /* to_uni */ + to_uni_hebrew_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -6975,12 +4045,12 @@ struct charset_info_st compiled_charsets[] = { "latin7_estonian_cs", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_latin7_estonian_cs, /* ctype */ - to_lower_latin7_estonian_cs, /* lower */ - to_upper_latin7_estonian_cs, /* upper */ + ctype_latin7_general_ci, /* ctype */ + to_lower_latin7_general_ci, /* to_lower */ + to_upper_latin7_general_ci, /* to_upper */ sort_order_latin7_estonian_cs, /* sort_order */ NULL, /* uca */ - to_uni_latin7_estonian_cs, /* to_uni */ + to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7008,12 +4078,12 @@ struct charset_info_st compiled_charsets[] = { "latin2_hungarian_ci", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_latin2_hungarian_ci, /* ctype */ - to_lower_latin2_hungarian_ci, /* lower */ - to_upper_latin2_hungarian_ci, /* upper */ + ctype_latin2_general_ci, /* ctype */ + to_lower_latin2_general_ci, /* to_lower */ + to_upper_latin2_general_ci, /* to_upper */ sort_order_latin2_hungarian_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin2_hungarian_ci, /* to_uni */ + to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7042,11 +4112,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_koi8u_general_ci, /* ctype */ - to_lower_koi8u_general_ci, /* lower */ - to_upper_koi8u_general_ci, /* upper */ + to_lower_koi8u_general_ci, /* to_lower */ + to_upper_koi8u_general_ci, /* to_upper */ sort_order_koi8u_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_koi8u_general_ci, /* to_uni */ + to_uni_koi8u_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7074,12 +4144,12 @@ struct charset_info_st compiled_charsets[] = { "cp1251_ukrainian_ci", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1251_ukrainian_ci, /* ctype */ - to_lower_cp1251_ukrainian_ci, /* lower */ - to_upper_cp1251_ukrainian_ci, /* upper */ + ctype_cp1251_general_ci, /* ctype */ + to_lower_cp1251_general_ci, /* to_lower */ + to_upper_cp1251_general_ci, /* to_upper */ sort_order_cp1251_ukrainian_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1251_ukrainian_ci, /* to_uni */ + to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7108,11 +4178,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_greek_general_ci, /* ctype */ - to_lower_greek_general_ci, /* lower */ - to_upper_greek_general_ci, /* upper */ + to_lower_greek_general_ci, /* to_lower */ + to_upper_greek_general_ci, /* to_upper */ sort_order_greek_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_greek_general_ci, /* to_uni */ + to_uni_greek_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7141,11 +4211,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_cp1250_general_ci, /* ctype */ - to_lower_cp1250_general_ci, /* lower */ - to_upper_cp1250_general_ci, /* upper */ + to_lower_cp1250_general_ci, /* to_lower */ + to_upper_cp1250_general_ci, /* to_upper */ sort_order_cp1250_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1250_general_ci, /* to_uni */ + to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7173,12 +4243,12 @@ struct charset_info_st compiled_charsets[] = { "latin2_croatian_ci", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_latin2_croatian_ci, /* ctype */ - to_lower_latin2_croatian_ci, /* lower */ - to_upper_latin2_croatian_ci, /* upper */ + ctype_latin2_general_ci, /* ctype */ + to_lower_latin2_general_ci, /* to_lower */ + to_upper_latin2_general_ci, /* to_upper */ sort_order_latin2_croatian_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin2_croatian_ci, /* to_uni */ + to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7206,12 +4276,12 @@ struct charset_info_st compiled_charsets[] = { "cp1257_lithuanian_ci", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1257_lithuanian_ci, /* ctype */ - to_lower_cp1257_lithuanian_ci, /* lower */ - to_upper_cp1257_lithuanian_ci, /* upper */ + ctype_cp1257_general_ci, /* ctype */ + to_lower_cp1257_general_ci, /* to_lower */ + to_upper_cp1257_general_ci, /* to_upper */ sort_order_cp1257_lithuanian_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1257_lithuanian_ci, /* to_uni */ + to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7240,11 +4310,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin5_turkish_ci, /* ctype */ - to_lower_latin5_turkish_ci, /* lower */ - to_upper_latin5_turkish_ci, /* upper */ + to_lower_latin5_turkish_ci, /* to_lower */ + to_upper_latin5_turkish_ci, /* to_upper */ sort_order_latin5_turkish_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin5_turkish_ci, /* to_uni */ + to_uni_latin5_turkish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7273,11 +4343,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_armscii8_general_ci, /* ctype */ - to_lower_armscii8_general_ci, /* lower */ - to_upper_armscii8_general_ci, /* upper */ + to_lower_armscii8_general_ci, /* to_lower */ + to_upper_armscii8_general_ci, /* to_upper */ sort_order_armscii8_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_armscii8_general_ci, /* to_uni */ + to_uni_armscii8_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7306,11 +4376,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_cp866_general_ci, /* ctype */ - to_lower_cp866_general_ci, /* lower */ - to_upper_cp866_general_ci, /* upper */ + to_lower_cp866_general_ci, /* to_lower */ + to_upper_cp866_general_ci, /* to_upper */ sort_order_cp866_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp866_general_ci, /* to_uni */ + to_uni_cp866_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7339,11 +4409,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_keybcs2_general_ci, /* ctype */ - to_lower_keybcs2_general_ci, /* lower */ - to_upper_keybcs2_general_ci, /* upper */ + to_lower_keybcs2_general_ci, /* to_lower */ + to_upper_keybcs2_general_ci, /* to_upper */ sort_order_keybcs2_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_keybcs2_general_ci, /* to_uni */ + to_uni_keybcs2_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7372,11 +4442,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_macce_general_ci, /* ctype */ - to_lower_macce_general_ci, /* lower */ - to_upper_macce_general_ci, /* upper */ + to_lower_macce_general_ci, /* to_lower */ + to_upper_macce_general_ci, /* to_upper */ sort_order_macce_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_macce_general_ci, /* to_uni */ + to_uni_macce_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7405,11 +4475,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_macroman_general_ci, /* ctype */ - to_lower_macroman_general_ci, /* lower */ - to_upper_macroman_general_ci, /* upper */ + to_lower_macroman_general_ci, /* to_lower */ + to_upper_macroman_general_ci, /* to_upper */ sort_order_macroman_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_macroman_general_ci, /* to_uni */ + to_uni_macroman_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7438,11 +4508,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_cp852_general_ci, /* ctype */ - to_lower_cp852_general_ci, /* lower */ - to_upper_cp852_general_ci, /* upper */ + to_lower_cp852_general_ci, /* to_lower */ + to_upper_cp852_general_ci, /* to_upper */ sort_order_cp852_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp852_general_ci, /* to_uni */ + to_uni_cp852_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7471,11 +4541,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin7_general_ci, /* ctype */ - to_lower_latin7_general_ci, /* lower */ - to_upper_latin7_general_ci, /* upper */ + to_lower_latin7_general_ci, /* to_lower */ + to_upper_latin7_general_ci, /* to_upper */ sort_order_latin7_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin7_general_ci, /* to_uni */ + to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7503,12 +4573,12 @@ struct charset_info_st compiled_charsets[] = { "latin7_general_cs", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_latin7_general_cs, /* ctype */ - to_lower_latin7_general_cs, /* lower */ - to_upper_latin7_general_cs, /* upper */ + ctype_latin7_general_ci, /* ctype */ + to_lower_latin7_general_ci, /* to_lower */ + to_upper_latin7_general_ci, /* to_upper */ sort_order_latin7_general_cs, /* sort_order */ NULL, /* uca */ - to_uni_latin7_general_cs, /* to_uni */ + to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7536,12 +4606,12 @@ struct charset_info_st compiled_charsets[] = { "macce_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_macce_bin, /* ctype */ - to_lower_macce_bin, /* lower */ - to_upper_macce_bin, /* upper */ + ctype_macce_general_ci, /* ctype */ + to_lower_macce_general_ci, /* to_lower */ + to_upper_macce_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_macce_bin, /* to_uni */ + to_uni_macce_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7569,12 +4639,12 @@ struct charset_info_st compiled_charsets[] = { "cp1250_croatian_ci", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1250_croatian_ci, /* ctype */ - to_lower_cp1250_croatian_ci, /* lower */ - to_upper_cp1250_croatian_ci, /* upper */ + ctype_cp1250_general_ci, /* ctype */ + to_lower_cp1250_general_ci, /* to_lower */ + to_upper_cp1250_general_ci, /* to_upper */ sort_order_cp1250_croatian_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1250_croatian_ci, /* to_uni */ + to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7603,11 +4673,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin1_general_ci, /* ctype */ - to_lower_latin1_general_ci, /* lower */ - to_upper_latin1_general_ci, /* upper */ + to_lower_latin1_general_ci, /* to_lower */ + to_upper_latin1_general_ci, /* to_upper */ sort_order_latin1_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin1_general_ci, /* to_uni */ + to_uni_latin1_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7636,11 +4706,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin1_general_cs, /* ctype */ - to_lower_latin1_general_cs, /* lower */ - to_upper_latin1_general_cs, /* upper */ + to_lower_latin1_general_cs, /* to_lower */ + to_upper_latin1_general_cs, /* to_upper */ sort_order_latin1_general_cs, /* sort_order */ NULL, /* uca */ - to_uni_latin1_general_cs, /* to_uni */ + to_uni_latin1_general_cs, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7668,12 +4738,12 @@ struct charset_info_st compiled_charsets[] = { "cp1251_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1251_bin, /* ctype */ - to_lower_cp1251_bin, /* lower */ - to_upper_cp1251_bin, /* upper */ + ctype_cp1251_general_ci, /* ctype */ + to_lower_cp1251_general_ci, /* to_lower */ + to_upper_cp1251_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_cp1251_bin, /* to_uni */ + to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7702,11 +4772,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_cp1251_general_ci, /* ctype */ - to_lower_cp1251_general_ci, /* lower */ - to_upper_cp1251_general_ci, /* upper */ + to_lower_cp1251_general_ci, /* to_lower */ + to_upper_cp1251_general_ci, /* to_upper */ sort_order_cp1251_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1251_general_ci, /* to_uni */ + to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7734,12 +4804,12 @@ struct charset_info_st compiled_charsets[] = { "cp1251_general_cs", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1251_general_cs, /* ctype */ - to_lower_cp1251_general_cs, /* lower */ - to_upper_cp1251_general_cs, /* upper */ + ctype_cp1251_general_ci, /* ctype */ + to_lower_cp1251_general_ci, /* to_lower */ + to_upper_cp1251_general_ci, /* to_upper */ sort_order_cp1251_general_cs, /* sort_order */ NULL, /* uca */ - to_uni_cp1251_general_cs, /* to_uni */ + to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7767,12 +4837,12 @@ struct charset_info_st compiled_charsets[] = { "macroman_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_macroman_bin, /* ctype */ - to_lower_macroman_bin, /* lower */ - to_upper_macroman_bin, /* upper */ + ctype_macroman_general_ci, /* ctype */ + to_lower_macroman_general_ci, /* to_lower */ + to_upper_macroman_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_macroman_bin, /* to_uni */ + to_uni_macroman_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7801,11 +4871,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_cp1256_general_ci, /* ctype */ - to_lower_cp1256_general_ci, /* lower */ - to_upper_cp1256_general_ci, /* upper */ + to_lower_cp1256_general_ci, /* to_lower */ + to_upper_cp1256_general_ci, /* to_upper */ sort_order_cp1256_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1256_general_ci, /* to_uni */ + to_uni_cp1256_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7833,12 +4903,12 @@ struct charset_info_st compiled_charsets[] = { "cp1257_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1257_bin, /* ctype */ - to_lower_cp1257_bin, /* lower */ - to_upper_cp1257_bin, /* upper */ + ctype_cp1257_general_ci, /* ctype */ + to_lower_cp1257_general_ci, /* to_lower */ + to_upper_cp1257_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_cp1257_bin, /* to_uni */ + to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7867,11 +4937,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_cp1257_general_ci, /* ctype */ - to_lower_cp1257_general_ci, /* lower */ - to_upper_cp1257_general_ci, /* upper */ + to_lower_cp1257_general_ci, /* to_lower */ + to_upper_cp1257_general_ci, /* to_upper */ sort_order_cp1257_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1257_general_ci, /* to_uni */ + to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7899,12 +4969,12 @@ struct charset_info_st compiled_charsets[] = { "armscii8_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_armscii8_bin, /* ctype */ - to_lower_armscii8_bin, /* lower */ - to_upper_armscii8_bin, /* upper */ + ctype_armscii8_general_ci, /* ctype */ + to_lower_armscii8_general_ci, /* to_lower */ + to_upper_armscii8_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_armscii8_bin, /* to_uni */ + to_uni_armscii8_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7932,12 +5002,12 @@ struct charset_info_st compiled_charsets[] = { "ascii_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_ascii_bin, /* ctype */ - to_lower_ascii_bin, /* lower */ - to_upper_ascii_bin, /* upper */ + ctype_ascii_general_ci, /* ctype */ + to_lower_ascii_general_ci, /* to_lower */ + to_upper_ascii_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_ascii_bin, /* to_uni */ + to_uni_ascii_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7965,12 +5035,12 @@ struct charset_info_st compiled_charsets[] = { "cp1250_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1250_bin, /* ctype */ - to_lower_cp1250_bin, /* lower */ - to_upper_cp1250_bin, /* upper */ + ctype_cp1250_general_ci, /* ctype */ + to_lower_cp1250_general_ci, /* to_lower */ + to_upper_cp1250_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_cp1250_bin, /* to_uni */ + to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -7998,12 +5068,12 @@ struct charset_info_st compiled_charsets[] = { "cp1256_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1256_bin, /* ctype */ - to_lower_cp1256_bin, /* lower */ - to_upper_cp1256_bin, /* upper */ + ctype_cp1256_general_ci, /* ctype */ + to_lower_cp1256_general_ci, /* to_lower */ + to_upper_cp1256_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_cp1256_bin, /* to_uni */ + to_uni_cp1256_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8031,12 +5101,12 @@ struct charset_info_st compiled_charsets[] = { "cp866_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp866_bin, /* ctype */ - to_lower_cp866_bin, /* lower */ - to_upper_cp866_bin, /* upper */ + ctype_cp866_general_ci, /* ctype */ + to_lower_cp866_general_ci, /* to_lower */ + to_upper_cp866_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_cp866_bin, /* to_uni */ + to_uni_cp866_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8064,12 +5134,12 @@ struct charset_info_st compiled_charsets[] = { "dec8_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_dec8_bin, /* ctype */ - to_lower_dec8_bin, /* lower */ - to_upper_dec8_bin, /* upper */ + ctype_dec8_swedish_ci, /* ctype */ + to_lower_dec8_swedish_ci, /* to_lower */ + to_upper_dec8_swedish_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_dec8_bin, /* to_uni */ + to_uni_dec8_swedish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8097,12 +5167,12 @@ struct charset_info_st compiled_charsets[] = { "greek_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_greek_bin, /* ctype */ - to_lower_greek_bin, /* lower */ - to_upper_greek_bin, /* upper */ + ctype_greek_general_ci, /* ctype */ + to_lower_greek_general_ci, /* to_lower */ + to_upper_greek_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_greek_bin, /* to_uni */ + to_uni_greek_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8130,12 +5200,12 @@ struct charset_info_st compiled_charsets[] = { "hebrew_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_hebrew_bin, /* ctype */ - to_lower_hebrew_bin, /* lower */ - to_upper_hebrew_bin, /* upper */ + ctype_hebrew_general_ci, /* ctype */ + to_lower_hebrew_general_ci, /* to_lower */ + to_upper_hebrew_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_hebrew_bin, /* to_uni */ + to_uni_hebrew_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8163,12 +5233,12 @@ struct charset_info_st compiled_charsets[] = { "hp8_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_hp8_bin, /* ctype */ - to_lower_hp8_bin, /* lower */ - to_upper_hp8_bin, /* upper */ + ctype_hp8_english_ci, /* ctype */ + to_lower_hp8_english_ci, /* to_lower */ + to_upper_hp8_english_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_hp8_bin, /* to_uni */ + to_uni_hp8_english_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8196,12 +5266,12 @@ struct charset_info_st compiled_charsets[] = { "keybcs2_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_keybcs2_bin, /* ctype */ - to_lower_keybcs2_bin, /* lower */ - to_upper_keybcs2_bin, /* upper */ + ctype_keybcs2_general_ci, /* ctype */ + to_lower_keybcs2_general_ci, /* to_lower */ + to_upper_keybcs2_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_keybcs2_bin, /* to_uni */ + to_uni_keybcs2_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8229,12 +5299,12 @@ struct charset_info_st compiled_charsets[] = { "koi8r_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_koi8r_bin, /* ctype */ - to_lower_koi8r_bin, /* lower */ - to_upper_koi8r_bin, /* upper */ + ctype_koi8r_general_ci, /* ctype */ + to_lower_koi8r_general_ci, /* to_lower */ + to_upper_koi8r_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_koi8r_bin, /* to_uni */ + to_uni_koi8r_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8262,12 +5332,12 @@ struct charset_info_st compiled_charsets[] = { "koi8u_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_koi8u_bin, /* ctype */ - to_lower_koi8u_bin, /* lower */ - to_upper_koi8u_bin, /* upper */ + ctype_koi8u_general_ci, /* ctype */ + to_lower_koi8u_general_ci, /* to_lower */ + to_upper_koi8u_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_koi8u_bin, /* to_uni */ + to_uni_koi8u_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8295,12 +5365,12 @@ struct charset_info_st compiled_charsets[] = { "latin2_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_latin2_bin, /* ctype */ - to_lower_latin2_bin, /* lower */ - to_upper_latin2_bin, /* upper */ + ctype_latin2_general_ci, /* ctype */ + to_lower_latin2_general_ci, /* to_lower */ + to_upper_latin2_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_latin2_bin, /* to_uni */ + to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8328,12 +5398,12 @@ struct charset_info_st compiled_charsets[] = { "latin5_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_latin5_bin, /* ctype */ - to_lower_latin5_bin, /* lower */ - to_upper_latin5_bin, /* upper */ + ctype_latin5_turkish_ci, /* ctype */ + to_lower_latin5_turkish_ci, /* to_lower */ + to_upper_latin5_turkish_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_latin5_bin, /* to_uni */ + to_uni_latin5_turkish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8361,12 +5431,12 @@ struct charset_info_st compiled_charsets[] = { "latin7_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_latin7_bin, /* ctype */ - to_lower_latin7_bin, /* lower */ - to_upper_latin7_bin, /* upper */ + ctype_latin7_general_ci, /* ctype */ + to_lower_latin7_general_ci, /* to_lower */ + to_upper_latin7_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_latin7_bin, /* to_uni */ + to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8394,12 +5464,12 @@ struct charset_info_st compiled_charsets[] = { "cp850_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp850_bin, /* ctype */ - to_lower_cp850_bin, /* lower */ - to_upper_cp850_bin, /* upper */ + ctype_cp850_general_ci, /* ctype */ + to_lower_cp850_general_ci, /* to_lower */ + to_upper_cp850_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_cp850_bin, /* to_uni */ + to_uni_cp850_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8427,12 +5497,12 @@ struct charset_info_st compiled_charsets[] = { "cp852_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp852_bin, /* ctype */ - to_lower_cp852_bin, /* lower */ - to_upper_cp852_bin, /* upper */ + ctype_cp852_general_ci, /* ctype */ + to_lower_cp852_general_ci, /* to_lower */ + to_upper_cp852_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_cp852_bin, /* to_uni */ + to_uni_cp852_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8460,12 +5530,12 @@ struct charset_info_st compiled_charsets[] = { "swe7_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_swe7_bin, /* ctype */ - to_lower_swe7_bin, /* lower */ - to_upper_swe7_bin, /* upper */ + ctype_swe7_swedish_ci, /* ctype */ + to_lower_swe7_swedish_ci, /* to_lower */ + to_upper_swe7_swedish_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_swe7_bin, /* to_uni */ + to_uni_swe7_swedish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8494,11 +5564,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_geostd8_general_ci, /* ctype */ - to_lower_geostd8_general_ci, /* lower */ - to_upper_geostd8_general_ci, /* upper */ + to_lower_geostd8_general_ci, /* to_lower */ + to_upper_geostd8_general_ci, /* to_upper */ sort_order_geostd8_general_ci, /* sort_order */ NULL, /* uca */ - to_uni_geostd8_general_ci, /* to_uni */ + to_uni_geostd8_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8526,12 +5596,12 @@ struct charset_info_st compiled_charsets[] = { "geostd8_bin", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_geostd8_bin, /* ctype */ - to_lower_geostd8_bin, /* lower */ - to_upper_geostd8_bin, /* upper */ + ctype_geostd8_general_ci, /* ctype */ + to_lower_geostd8_general_ci, /* to_lower */ + to_upper_geostd8_general_ci, /* to_upper */ NULL, /* sort_order */ NULL, /* uca */ - to_uni_geostd8_bin, /* to_uni */ + to_uni_geostd8_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8560,11 +5630,11 @@ struct charset_info_st compiled_charsets[] = { "", /* comment */ NULL, /* tailoring */ ctype_latin1_spanish_ci, /* ctype */ - to_lower_latin1_spanish_ci, /* lower */ - to_upper_latin1_spanish_ci, /* upper */ + to_lower_latin1_spanish_ci, /* to_lower */ + to_upper_latin1_spanish_ci, /* to_upper */ sort_order_latin1_spanish_ci, /* sort_order */ NULL, /* uca */ - to_uni_latin1_spanish_ci, /* to_uni */ + to_uni_latin1_spanish_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8592,12 +5662,12 @@ struct charset_info_st compiled_charsets[] = { "cp1250_polish_ci", /* coll name */ "", /* comment */ NULL, /* tailoring */ - ctype_cp1250_polish_ci, /* ctype */ - to_lower_cp1250_polish_ci, /* lower */ - to_upper_cp1250_polish_ci, /* upper */ + ctype_cp1250_general_ci, /* ctype */ + to_lower_cp1250_general_ci, /* to_lower */ + to_upper_cp1250_general_ci, /* to_upper */ sort_order_cp1250_polish_ci, /* sort_order */ NULL, /* uca */ - to_uni_cp1250_polish_ci, /* to_uni */ + to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ &my_unicase_default, /* caseinfo */ NULL, /* state map */ @@ -8617,6 +5687,1524 @@ struct charset_info_st compiled_charsets[] = { } , #endif +#ifdef HAVE_CHARSET_dec8 +{ + 1027,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "dec8", /* cset name */ + "dec8_swedish_nopad_ci", /* coll name */ + "", /* comment */ + "[import dec8_swedish_ci]", /* tailoring */ + ctype_dec8_swedish_ci, /* ctype */ + to_lower_dec8_swedish_ci, /* to_lower */ + to_upper_dec8_swedish_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_dec8_swedish_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp850 +{ + 1028,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "cp850", /* cset name */ + "cp850_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import cp850_general_ci]", /* tailoring */ + ctype_cp850_general_ci, /* ctype */ + to_lower_cp850_general_ci, /* to_lower */ + to_upper_cp850_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp850_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hp8 +{ + 1030,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "hp8", /* cset name */ + "hp8_english_nopad_ci", /* coll name */ + "", /* comment */ + "[import hp8_english_ci]", /* tailoring */ + ctype_hp8_english_ci, /* ctype */ + to_lower_hp8_english_ci, /* to_lower */ + to_upper_hp8_english_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_hp8_english_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8r +{ + 1031,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "koi8r", /* cset name */ + "koi8r_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import koi8r_general_ci]", /* tailoring */ + ctype_koi8r_general_ci, /* ctype */ + to_lower_koi8r_general_ci, /* to_lower */ + to_upper_koi8r_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_koi8r_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin2 +{ + 1033,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "latin2", /* cset name */ + "latin2_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import latin2_general_ci]", /* tailoring */ + ctype_latin2_general_ci, /* ctype */ + to_lower_latin2_general_ci, /* to_lower */ + to_upper_latin2_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_latin2_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_swe7 +{ + 1034,0,0, + MY_CS_COMPILED|MY_CS_NONASCII|MY_CS_NOPAD, + "swe7", /* cset name */ + "swe7_swedish_nopad_ci", /* coll name */ + "", /* comment */ + "[import swe7_swedish_ci]", /* tailoring */ + ctype_swe7_swedish_ci, /* ctype */ + to_lower_swe7_swedish_ci, /* to_lower */ + to_upper_swe7_swedish_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_swe7_swedish_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_ascii +{ + 1035,0,0, + MY_CS_COMPILED|MY_CS_PUREASCII|MY_CS_NOPAD, + "ascii", /* cset name */ + "ascii_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import ascii_general_ci]", /* tailoring */ + ctype_ascii_general_ci, /* ctype */ + to_lower_ascii_general_ci, /* to_lower */ + to_upper_ascii_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_ascii_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hebrew +{ + 1040,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "hebrew", /* cset name */ + "hebrew_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import hebrew_general_ci]", /* tailoring */ + ctype_hebrew_general_ci, /* ctype */ + to_lower_hebrew_general_ci, /* to_lower */ + to_upper_hebrew_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_hebrew_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8u +{ + 1046,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "koi8u", /* cset name */ + "koi8u_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import koi8u_general_ci]", /* tailoring */ + ctype_koi8u_general_ci, /* ctype */ + to_lower_koi8u_general_ci, /* to_lower */ + to_upper_koi8u_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_koi8u_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_greek +{ + 1049,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "greek", /* cset name */ + "greek_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import greek_general_ci]", /* tailoring */ + ctype_greek_general_ci, /* ctype */ + to_lower_greek_general_ci, /* to_lower */ + to_upper_greek_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_greek_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1250 +{ + 1050,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "cp1250", /* cset name */ + "cp1250_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import cp1250_general_ci]", /* tailoring */ + ctype_cp1250_general_ci, /* ctype */ + to_lower_cp1250_general_ci, /* to_lower */ + to_upper_cp1250_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1250_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin5 +{ + 1054,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "latin5", /* cset name */ + "latin5_turkish_nopad_ci", /* coll name */ + "", /* comment */ + "[import latin5_turkish_ci]", /* tailoring */ + ctype_latin5_turkish_ci, /* ctype */ + to_lower_latin5_turkish_ci, /* to_lower */ + to_upper_latin5_turkish_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_latin5_turkish_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_armscii8 +{ + 1056,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "armscii8", /* cset name */ + "armscii8_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import armscii8_general_ci]", /* tailoring */ + ctype_armscii8_general_ci, /* ctype */ + to_lower_armscii8_general_ci, /* to_lower */ + to_upper_armscii8_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_armscii8_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp866 +{ + 1060,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "cp866", /* cset name */ + "cp866_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import cp866_general_ci]", /* tailoring */ + ctype_cp866_general_ci, /* ctype */ + to_lower_cp866_general_ci, /* to_lower */ + to_upper_cp866_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp866_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_keybcs2 +{ + 1061,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "keybcs2", /* cset name */ + "keybcs2_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import keybcs2_general_ci]", /* tailoring */ + ctype_keybcs2_general_ci, /* ctype */ + to_lower_keybcs2_general_ci, /* to_lower */ + to_upper_keybcs2_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_keybcs2_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macce +{ + 1062,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "macce", /* cset name */ + "macce_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import macce_general_ci]", /* tailoring */ + ctype_macce_general_ci, /* ctype */ + to_lower_macce_general_ci, /* to_lower */ + to_upper_macce_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_macce_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macroman +{ + 1063,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "macroman", /* cset name */ + "macroman_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import macroman_general_ci]", /* tailoring */ + ctype_macroman_general_ci, /* ctype */ + to_lower_macroman_general_ci, /* to_lower */ + to_upper_macroman_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_macroman_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp852 +{ + 1064,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "cp852", /* cset name */ + "cp852_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import cp852_general_ci]", /* tailoring */ + ctype_cp852_general_ci, /* ctype */ + to_lower_cp852_general_ci, /* to_lower */ + to_upper_cp852_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp852_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin7 +{ + 1065,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "latin7", /* cset name */ + "latin7_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import latin7_general_ci]", /* tailoring */ + ctype_latin7_general_ci, /* ctype */ + to_lower_latin7_general_ci, /* to_lower */ + to_upper_latin7_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_latin7_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macce +{ + 1067,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "macce", /* cset name */ + "macce_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_macce_general_ci, /* ctype */ + to_lower_macce_general_ci, /* to_lower */ + to_upper_macce_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_macce_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1251 +{ + 1074,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "cp1251", /* cset name */ + "cp1251_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1251_general_ci, /* ctype */ + to_lower_cp1251_general_ci, /* to_lower */ + to_upper_cp1251_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1251_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1251 +{ + 1075,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "cp1251", /* cset name */ + "cp1251_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import cp1251_general_ci]", /* tailoring */ + ctype_cp1251_general_ci, /* ctype */ + to_lower_cp1251_general_ci, /* to_lower */ + to_upper_cp1251_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1251_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macroman +{ + 1077,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "macroman", /* cset name */ + "macroman_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_macroman_general_ci, /* ctype */ + to_lower_macroman_general_ci, /* to_lower */ + to_upper_macroman_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_macroman_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1256 +{ + 1081,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "cp1256", /* cset name */ + "cp1256_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import cp1256_general_ci]", /* tailoring */ + ctype_cp1256_general_ci, /* ctype */ + to_lower_cp1256_general_ci, /* to_lower */ + to_upper_cp1256_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1256_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1257 +{ + 1082,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "cp1257", /* cset name */ + "cp1257_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1257_general_ci, /* ctype */ + to_lower_cp1257_general_ci, /* to_lower */ + to_upper_cp1257_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1257_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1257 +{ + 1083,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "cp1257", /* cset name */ + "cp1257_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import cp1257_general_ci]", /* tailoring */ + ctype_cp1257_general_ci, /* ctype */ + to_lower_cp1257_general_ci, /* to_lower */ + to_upper_cp1257_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1257_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_armscii8 +{ + 1088,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "armscii8", /* cset name */ + "armscii8_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_armscii8_general_ci, /* ctype */ + to_lower_armscii8_general_ci, /* to_lower */ + to_upper_armscii8_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_armscii8_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_ascii +{ + 1089,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PUREASCII|MY_CS_NOPAD, + "ascii", /* cset name */ + "ascii_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ascii_general_ci, /* ctype */ + to_lower_ascii_general_ci, /* to_lower */ + to_upper_ascii_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_ascii_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1250 +{ + 1090,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "cp1250", /* cset name */ + "cp1250_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1250_general_ci, /* ctype */ + to_lower_cp1250_general_ci, /* to_lower */ + to_upper_cp1250_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1250_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1256 +{ + 1091,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "cp1256", /* cset name */ + "cp1256_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1256_general_ci, /* ctype */ + to_lower_cp1256_general_ci, /* to_lower */ + to_upper_cp1256_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp1256_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp866 +{ + 1092,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "cp866", /* cset name */ + "cp866_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp866_general_ci, /* ctype */ + to_lower_cp866_general_ci, /* to_lower */ + to_upper_cp866_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp866_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_dec8 +{ + 1093,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "dec8", /* cset name */ + "dec8_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_dec8_swedish_ci, /* ctype */ + to_lower_dec8_swedish_ci, /* to_lower */ + to_upper_dec8_swedish_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_dec8_swedish_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_greek +{ + 1094,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "greek", /* cset name */ + "greek_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_greek_general_ci, /* ctype */ + to_lower_greek_general_ci, /* to_lower */ + to_upper_greek_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_greek_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hebrew +{ + 1095,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "hebrew", /* cset name */ + "hebrew_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_hebrew_general_ci, /* ctype */ + to_lower_hebrew_general_ci, /* to_lower */ + to_upper_hebrew_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_hebrew_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hp8 +{ + 1096,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "hp8", /* cset name */ + "hp8_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_hp8_english_ci, /* ctype */ + to_lower_hp8_english_ci, /* to_lower */ + to_upper_hp8_english_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_hp8_english_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_keybcs2 +{ + 1097,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "keybcs2", /* cset name */ + "keybcs2_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_keybcs2_general_ci, /* ctype */ + to_lower_keybcs2_general_ci, /* to_lower */ + to_upper_keybcs2_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_keybcs2_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8r +{ + 1098,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "koi8r", /* cset name */ + "koi8r_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_koi8r_general_ci, /* ctype */ + to_lower_koi8r_general_ci, /* to_lower */ + to_upper_koi8r_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_koi8r_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8u +{ + 1099,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "koi8u", /* cset name */ + "koi8u_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_koi8u_general_ci, /* ctype */ + to_lower_koi8u_general_ci, /* to_lower */ + to_upper_koi8u_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_koi8u_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin2 +{ + 1101,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "latin2", /* cset name */ + "latin2_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin2_general_ci, /* ctype */ + to_lower_latin2_general_ci, /* to_lower */ + to_upper_latin2_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_latin2_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin5 +{ + 1102,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "latin5", /* cset name */ + "latin5_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin5_turkish_ci, /* ctype */ + to_lower_latin5_turkish_ci, /* to_lower */ + to_upper_latin5_turkish_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_latin5_turkish_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin7 +{ + 1103,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "latin7", /* cset name */ + "latin7_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin7_general_ci, /* ctype */ + to_lower_latin7_general_ci, /* to_lower */ + to_upper_latin7_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_latin7_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp850 +{ + 1104,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "cp850", /* cset name */ + "cp850_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp850_general_ci, /* ctype */ + to_lower_cp850_general_ci, /* to_lower */ + to_upper_cp850_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp850_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp852 +{ + 1105,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "cp852", /* cset name */ + "cp852_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp852_general_ci, /* ctype */ + to_lower_cp852_general_ci, /* to_lower */ + to_upper_cp852_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_cp852_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_swe7 +{ + 1106,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII|MY_CS_NOPAD, + "swe7", /* cset name */ + "swe7_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_swe7_swedish_ci, /* ctype */ + to_lower_swe7_swedish_ci, /* to_lower */ + to_upper_swe7_swedish_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_swe7_swedish_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_geostd8 +{ + 1116,0,0, + MY_CS_COMPILED|MY_CS_NOPAD, + "geostd8", /* cset name */ + "geostd8_general_nopad_ci", /* coll name */ + "", /* comment */ + "[import geostd8_general_ci]", /* tailoring */ + ctype_geostd8_general_ci, /* ctype */ + to_lower_geostd8_general_ci, /* to_lower */ + to_upper_geostd8_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_geostd8_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_nopad_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_geostd8 +{ + 1117,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, + "geostd8", /* cset name */ + "geostd8_nopad_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_geostd8_general_ci, /* ctype */ + to_lower_geostd8_general_ci, /* to_lower */ + to_upper_geostd8_general_ci, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + to_uni_geostd8_general_ci, /* to_uni */ + NULL, /* from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_nopad_bin_handler, +} +, +#endif { 0,0,0, MY_CS_COMPILED, diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 5030360bc74..166619bf5cc 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -173,18 +173,6 @@ static const uchar sort_order_gb2312[]= #include "ctype-mb.ic" -static uint ismbchar_gb2312(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return (isgb2312head(*(p)) && (e)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0); -} - -static uint mbcharlen_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c) -{ - return (isgb2312head(c)? 2 : 1); -} - - static MY_UNICASE_CHARACTER cA2[256]= { {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */ @@ -6355,6 +6343,20 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_chinese_nopad_ci +#define WEIGHT_MB1(x) (sort_order_gb2312[(uchar) (x)]) +#define WEIGHT_MB2(x,y) (gb2312code(x, y)) +#include "strcoll.ic" + + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_nopad_bin +#define WEIGHT_MB1(x) ((uchar) (x)) +#define WEIGHT_MB2(x,y) (gb2312code(x, y)) +#include "strcoll.ic" + + static MY_COLLATION_HANDLER my_collation_handler_gb2312_chinese_ci= { NULL, /* init */ @@ -6387,15 +6389,43 @@ static MY_COLLATION_HANDLER my_collation_handler_gb2312_bin= }; +static MY_COLLATION_HANDLER my_collation_handler_gb2312_chinese_nopad_ci= +{ + NULL, /* init */ + my_strnncoll_gb2312_chinese_ci, + my_strnncollsp_gb2312_chinese_nopad_ci, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb, + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_handler_gb2312_nopad_bin= +{ + NULL, /* init */ + my_strnncoll_gb2312_bin, + my_strnncollsp_gb2312_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - ismbchar_gb2312, - mbcharlen_gb2312, my_numchars_mb, my_charpos_mb, - my_well_formed_len_gb2312, my_lengthsp_8bit, my_numcells_8bit, my_mb_wc_gb2312, /* mb_wc */ @@ -6489,4 +6519,70 @@ struct charset_info_st my_charset_gb2312_bin= &my_collation_handler_gb2312_bin }; + +struct charset_info_st my_charset_gb2312_chinese_nopad_ci= +{ + MY_NOPAD_ID(24),0,0,/* number */ + MY_CS_COMPILED|MY_CS_NOPAD, /* state */ + "gb2312", /* cs name */ + "gb2312_chinese_nopad_ci",/* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gb2312, + to_lower_gb2312, + to_upper_gb2312, + sort_order_gb2312, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_gb2312,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xF7FE, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_gb2312_chinese_nopad_ci +}; + + +struct charset_info_st my_charset_gb2312_nopad_bin= +{ + MY_NOPAD_ID(86),0,0,/* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "gb2312", /* cs name */ + "gb2312_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gb2312, + to_lower_gb2312, + to_upper_gb2312, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_gb2312,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xF7FE, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_gb2312_nopad_bin +}; + #endif diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 602255e9aee..efaa2e5c728 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -3451,49 +3451,6 @@ static uint16 gbksortorder(uint16 i) } -static size_t -my_strnxfrm_gbk(CHARSET_INFO *cs, - uchar *dst, size_t dstlen, uint nweights, - const uchar *src, size_t srclen, uint flags) -{ - uchar *d0= dst; - uchar *de= dst + dstlen; - const uchar *se= src + srclen; - const uchar *sort_order= cs->sort_order; - - for (; dst < de && src < se && nweights; nweights--) - { - if (cs->cset->ismbchar(cs, (const char*) src, (const char*) se)) - { - /* - Note, it is safe not to check (src < se) - in the code below, because ismbchar() would - not return TRUE if src was too short - */ - uint16 e= gbksortorder((uint16) gbkcode(*src, *(src + 1))); - *dst++= gbkhead(e); - if (dst < de) - *dst++= gbktail(e); - src+= 2; - } - else - *dst++= sort_order ? sort_order[*src++] : *src++; - } - return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); -} - - -static uint ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return (isgbkhead(*(p)) && (e)-(p)>1 && isgbktail(*((p)+1))? 2: 0); -} - -static uint mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c) -{ - return (isgbkhead(c)? 2 : 1); -} - /* page 0 0x8140-0xFE4F */ static const uint16 tab_gbk_uni0[]={ 0x4E02,0x4E04,0x4E05,0x4E06,0x4E0F,0x4E12,0x4E17,0x4E1F, @@ -10658,6 +10615,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _gbk_chinese_ci #define WEIGHT_MB1(x) (sort_order_gbk[(uchar) (x)]) #define WEIGHT_MB2(x,y) (gbksortorder(gbkcode(x,y))) +#define DEFINE_STRNXFRM #include "strcoll.ic" @@ -10667,12 +10625,27 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _gbk_chinese_nopad_ci +#define WEIGHT_MB1(x) (sort_order_gbk[(uchar) (x)]) +#define WEIGHT_MB2(x,y) (gbksortorder(gbkcode(x,y))) +#define DEFINE_STRNXFRM +#include "strcoll.ic" + + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _gbk_nopad_bin +#define WEIGHT_MB1(x) ((uchar) (x)) +#define WEIGHT_MB2(x,y) (gbkcode(x,y)) +#include "strcoll.ic" + + static MY_COLLATION_HANDLER my_collation_handler_gbk_chinese_ci= { NULL, /* init */ my_strnncoll_gbk_chinese_ci, my_strnncollsp_gbk_chinese_ci, - my_strnxfrm_gbk, + my_strnxfrm_gbk_chinese_ci, my_strnxfrmlen_simple, my_like_range_mb, my_wildcmp_mb, @@ -10699,15 +10672,42 @@ static MY_COLLATION_HANDLER my_collation_handler_gbk_bin= }; +static MY_COLLATION_HANDLER my_collation_handler_gbk_chinese_nopad_ci= +{ + NULL, /* init */ + my_strnncoll_gbk_chinese_ci, + my_strnncollsp_gbk_chinese_nopad_ci, + my_strnxfrm_gbk_chinese_nopad_ci, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb, + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_handler_gbk_nopad_bin= +{ + NULL, /* init */ + my_strnncoll_gbk_bin, + my_strnncollsp_gbk_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - ismbchar_gbk, - mbcharlen_gbk, my_numchars_mb, my_charpos_mb, - my_well_formed_len_gbk, my_lengthsp_8bit, my_numcells_8bit, my_mb_wc_gbk, @@ -10801,4 +10801,68 @@ struct charset_info_st my_charset_gbk_bin= }; +struct charset_info_st my_charset_gbk_chinese_nopad_ci= +{ + MY_NOPAD_ID(28),0,0,/* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NOPAD, /* state */ + "gbk", /* cs name */ + "gbk_chinese_nopad_ci",/* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gbk, + to_lower_gbk, + to_upper_gbk, + sort_order_gbk, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_gbk, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xA967, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_gbk_chinese_nopad_ci +}; + +struct charset_info_st my_charset_gbk_nopad_bin= +{ + MY_NOPAD_ID(87),0,0,/* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "gbk", /* cs name */ + "gbk_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gbk, + to_lower_gbk, + to_upper_gbk, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_gbk, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFEFE, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_gbk_nopad_bin +}; + #endif diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 37f43c6bce5..f9fa1488aa6 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -396,11 +396,8 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - NULL, - my_mbcharlen_8bit, my_numchars_8bit, my_charpos_8bit, - my_well_formed_len_8bit, my_lengthsp_8bit, my_numcells_8bit, my_mb_wc_latin1, @@ -462,6 +459,39 @@ struct charset_info_st my_charset_latin1= }; +struct charset_info_st my_charset_latin1_nopad= +{ + MY_NOPAD_ID(8),0,0, /* number */ + MY_CS_COMPILED | MY_CS_NOPAD, /* state */ + "latin1", /* cs name */ + "latin1_swedish_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1, + to_lower_latin1, + to_upper_latin1, + sort_order_latin1, + NULL, /* uca */ + cs_to_uni, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_8bit_simple_nopad_ci_handler +}; + + /* @@ -598,16 +628,10 @@ static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)), static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)), const uchar *a, size_t a_length, - const uchar *b, size_t b_length, - my_bool diff_if_only_endspace_difference) + const uchar *b, size_t b_length) { const uchar *a_end= a + a_length, *b_end= b + b_length; uchar a_char, a_extend= 0, b_char, b_extend= 0; - int res; - -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif while ((a < a_end || a_extend) && (b < b_end || b_extend)) { @@ -640,31 +664,11 @@ static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)), if (b_extend) return -1; - res= 0; - if (a != a_end || b != b_end) - { - int swap= 1; - if (diff_if_only_endspace_difference) - res= 1; /* Assume 'a' is bigger */ - /* - Check the next not space character of the longer key. If it's < ' ', - then it's smaller than the other key. - */ - if (a == a_end) - { - /* put shorter key in a */ - a_end= b_end; - a= b; - swap= -1; /* swap sign of result */ - res= -res; - } - for ( ; a < a_end ; a++) - { - if (*a != ' ') - return (*a < ' ') ? -swap : swap; - } - } - return res; + if (a < a_end) + return my_strnncollsp_padspace_bin(a, a_end - a); + if (b < b_end) + return -my_strnncollsp_padspace_bin(b, b_end - b); + return 0; } @@ -798,3 +802,36 @@ struct charset_info_st my_charset_latin1_bin= &my_collation_8bit_bin_handler }; + +struct charset_info_st my_charset_latin1_nopad_bin= +{ + MY_NOPAD_ID(47),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD,/* state */ + "latin1", /* cs name */ + "latin1_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1, + to_lower_latin1, + to_upper_latin1, + NULL, /* sort_order */ + NULL, /* uca */ + cs_to_uni, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_8bit_nopad_bin_handler +}; + diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 3f8556fb872..3bcd29bbb8b 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -158,7 +158,7 @@ int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t) if (*s++ != *t++) return 1; } - else if (my_mbcharlen(cs, *t) > 1) + else if (my_charlen(cs, t, t + cs->mbmaxlen) > 1) return 1; else if (map[(uchar) *s++] != map[(uchar) *t++]) return 1; @@ -329,28 +329,6 @@ size_t my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)), } -size_t my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e, - size_t pos, int *error) -{ - const char *b_start= b; - *error= 0; - while (pos) - { - my_wc_t wc; - int mb_len; - - if ((mb_len= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0) - { - *error= b < e ? 1 : 0; - break; - } - b+= mb_len; - pos--; - } - return (size_t) (b - b_start); -} - - /* Append a badly formed piece of string. Bad bytes are fixed to '?'. @@ -478,12 +456,12 @@ uint my_instr_mb(CHARSET_INFO *cs, if (nmatch) { match[0].beg= 0; - match[0].end= (size_t) (b-b0); + match[0].end= (uint) (b-b0); match[0].mb_len= res; if (nmatch > 1) { match[1].beg= match[0].end; - match[1].end= match[0].end+s_length; + match[1].end= (uint)(match[0].end+s_length); match[1].mb_len= 0; /* Not computed */ } } @@ -499,93 +477,6 @@ uint my_instr_mb(CHARSET_INFO *cs, } -/* BINARY collations handlers for MB charsets */ - -int -my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)), - const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool t_is_prefix) -{ - size_t len=MY_MIN(slen,tlen); - int cmp= memcmp(s,t,len); - return cmp ? cmp : (int) ((t_is_prefix ? len : slen) - tlen); -} - - -/* - Compare two strings. - - SYNOPSIS - my_strnncollsp_mb_bin() - cs Chararacter set - s String to compare - slen Length of 's' - t String to compare - tlen Length of 't' - diff_if_only_endspace_difference - Set to 1 if the strings should be regarded as different - if they only difference in end space - - NOTE - This function is used for character strings with binary collations. - The shorter string is extended with end space to be as long as the longer - one. - - RETURN - A negative number if s < t - A positive number if s > t - 0 if strings are equal -*/ - -int -my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), - const uchar *a, size_t a_length, - const uchar *b, size_t b_length, - my_bool diff_if_only_endspace_difference) -{ - const uchar *end; - size_t length; - int res; - -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif - - end= a + (length= MY_MIN(a_length, b_length)); - while (a < end) - { - if (*a++ != *b++) - return ((int) a[-1] - (int) b[-1]); - } - res= 0; - if (a_length != b_length) - { - int swap= 1; - if (diff_if_only_endspace_difference) - res= 1; /* Assume 'a' is bigger */ - /* - Check the next not space character of the longer key. If it's < ' ', - then it's smaller than the other key. - */ - if (a_length < b_length) - { - /* put shorter key in s */ - a_length= b_length; - a= b; - swap= -1; /* swap sign of result */ - res= -res; - } - for (end= a + a_length-length; a < end ; a++) - { - if (*a != ' ') - return (*a < ' ') ? -swap : swap; - } - } - return res; -} - - /* Copy one non-ascii character. "dst" must have enough room for the character. @@ -596,7 +487,7 @@ my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), */ #define my_strnxfrm_mb_non_ascii_char(cs, dst, src, se) \ { \ - switch (cs->cset->ismbchar(cs, (const char*) src, (const char*) se)) { \ + switch (my_ismbchar(cs, (const char *) src, (const char *) se)) { \ case 4: \ *dst++= *src++; \ /* fall through */ \ @@ -617,13 +508,10 @@ my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), characters having multibyte weights *equal* to their codes: cp932, euckr, gb2312, sjis, eucjpms, ujis. */ -size_t -my_strnxfrm_mb(CHARSET_INFO *cs, - uchar *dst, size_t dstlen, uint nweights, - const uchar *src, size_t srclen, uint flags) +size_t my_strnxfrm_mb_internal(CHARSET_INFO *cs, uchar *dst, uchar *de, + uint *nweights, const uchar *src, size_t srclen) { uchar *d0= dst; - uchar *de= dst + dstlen; const uchar *se= src + srclen; const uchar *sort_order= cs->sort_order; @@ -634,12 +522,12 @@ my_strnxfrm_mb(CHARSET_INFO *cs, then we can run a simplified loop - without checking "nweights" and "de". */ - if (dstlen >= srclen && nweights >= srclen) + if (de >= d0 + srclen && *nweights >= srclen) { if (sort_order) { /* Optimized version for a case insensitive collation */ - for (; src < se; nweights--) + for (; src < se; (*nweights)--) { if (*src < 128) /* quickly catch ASCII characters */ *dst++= sort_order[*src++]; @@ -650,7 +538,7 @@ my_strnxfrm_mb(CHARSET_INFO *cs, else { /* Optimized version for a case sensitive collation (no sort_order) */ - for (; src < se; nweights--) + for (; src < se; (*nweights)--) { if (*src < 128) /* quickly catch ASCII characters */ *dst++= *src++; @@ -658,18 +546,18 @@ my_strnxfrm_mb(CHARSET_INFO *cs, my_strnxfrm_mb_non_ascii_char(cs, dst, src, se); } } - goto pad; + goto end; } /* A thourough loop, checking all possible limits: "se", "nweights" and "de". */ - for (; src < se && nweights && dst < de; nweights--) + for (; src < se && *nweights && dst < de; (*nweights)--) { int chlen; - if (*src < 128 || - !(chlen= cs->cset->ismbchar(cs, (const char*) src, (const char*) se))) + if (*src < 128 || !(chlen= my_ismbchar(cs, (const char *) src, + (const char *) se))) { /* Single byte character */ *dst++= sort_order ? sort_order[*src++] : *src++; @@ -677,18 +565,43 @@ my_strnxfrm_mb(CHARSET_INFO *cs, else { /* Multi-byte character */ - int len= (dst + chlen <= de) ? chlen : de - dst; + size_t len= (dst + chlen <= de) ? chlen : de - dst; memcpy(dst, src, len); dst+= len; src+= len; } } -pad: +end: + return dst - d0; +} + + +size_t +my_strnxfrm_mb(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *de= dst + dstlen; + uchar *d0= dst; + dst= d0 + my_strnxfrm_mb_internal(cs, dst, de, &nweights, src, srclen); return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); } +size_t +my_strnxfrm_mb_nopad(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *de= dst + dstlen; + uchar *d0= dst; + dst= d0 + my_strnxfrm_mb_internal(cs, dst, de, &nweights, src, srclen); + return my_strxfrm_pad_desc_and_reverse_nopad(cs, d0, dst, de, nweights, + flags, 0); +} + + int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), const char *s, const char *t) @@ -697,18 +610,13 @@ my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), } + void -my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), - const uchar *key, size_t len,ulong *nr1, ulong *nr2) +my_hash_sort_mb_nopad_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2) { register ulong m1= *nr1, m2= *nr2; - - /* - Remove trailing spaces. We have to do this to be able to compare - 'A ' and 'A' as identical - */ - const uchar *end = skip_trailing_space(key, len); - + const uchar *end= key + len; for (; key < end ; key++) { MY_HASH_ADD(m1, m2, (uint)*key); @@ -718,6 +626,19 @@ my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), } +void +my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2) +{ + /* + Remove trailing spaces. We have to do this to be able to compare + 'A ' and 'A' as identical + */ + const uchar *end= skip_trailing_space(key, len); + my_hash_sort_mb_nopad_bin(cs, key, end - key, nr1, nr2); +} + + /* Fill the given buffer with 'maximum character' for given charset SYNOPSIS @@ -806,9 +727,9 @@ fill_max_and_min: 'a\0\0... is the smallest possible string when we have space expand a\ff\ff... is the biggest possible string */ - *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : - res_length); - *max_length= res_length; + *min_length= (cs->state & (MY_CS_BINSORT | MY_CS_NOPAD)) ? + (size_t) (min_str - min_org) : + res_length; /* Create min key */ do { @@ -1009,9 +930,9 @@ my_like_range_generic(CHARSET_INFO *cs, a\min\min... is the smallest possible string a\max\max... is the biggest possible string */ - *min_length= ((cs->state & MY_CS_BINSORT) ? + *min_length= (cs->state & (MY_CS_BINSORT | MY_CS_NOPAD)) ? (size_t) (min_str - min_org) : - res_length); + res_length; *max_length= res_length; goto pad_min_max; } diff --git a/strings/ctype-mb.ic b/strings/ctype-mb.ic index 7e278ea386d..336c482d24f 100644 --- a/strings/ctype-mb.ic +++ b/strings/ctype-mb.ic @@ -30,7 +30,6 @@ #ifdef DEFINE_ASIAN_ROUTINES -#define DEFINE_WELL_FORMED_LEN #define DEFINE_WELL_FORMED_CHAR_LENGTH #define DEFINE_CHARLEN #define DEFINE_NATIVE_TO_MB_VARLEN @@ -75,7 +74,13 @@ MY_FUNCTION_NAME(charlen)(CHARSET_INFO *cs __attribute__((unused)), #ifdef IS_MB3_CHAR if (b + 3 > e) + { +#ifdef IS_MB_PREFIX2 + if (!IS_MB_PREFIX2(b[0], b[1])) + return MY_CS_ILSEQ; +#endif return MY_CS_TOOSMALLN(3); + } if (IS_MB3_CHAR(b[0], b[1], b[2])) return 3; /* Three-byte character */ #endif @@ -90,73 +95,7 @@ MY_FUNCTION_NAME(charlen)(CHARSET_INFO *cs __attribute__((unused)), /* Wrong byte sequence */ return MY_CS_ILSEQ; } -#endif /* DEFINE_WELL_FORMED_LEN */ - - -#ifdef DEFINE_WELL_FORMED_LEN -/** - Returns well formed length of a character string with - variable character length for character sets with: - - mbminlen == 1 - - mbmaxlen == 2, 3, or 4 -*/ -static size_t -MY_FUNCTION_NAME(well_formed_len)(CHARSET_INFO *cs __attribute__((unused)), - const char *b, const char *e, - size_t nchars, int *error) -{ - const char *b0= b; - - DBUG_ASSERT(cs->mbminlen == 1); - DBUG_ASSERT(cs->mbmaxlen <= 4); - - for (*error= 0 ; b < e && nchars-- ; ) - { - if ((uchar) b[0] < 128) - { - b++; /* Single byte ASCII character */ - continue; - } - - if (b + 2 <= e && IS_MB2_CHAR(b[0], b[1])) - { - b+= 2; /* Double byte character */ - continue; - } - -#ifdef IS_MB3_CHAR - if (b + 3 <= e && IS_MB3_CHAR(b[0], b[1], b[2])) - { - b+= 3; /* Three-byte character */ - continue; - } -#endif - -#ifdef IS_MB4_CHAR - if (b + 4 <= e && IS_MB4_CHAR(b[0], b[1], b[2], b[3])) - { - b+= 4; /* Four-byte character */ - continue; - } -#endif - -#ifdef IS_8BIT_CHAR - if (IS_8BIT_CHAR(b[0])) - { - b++; /* Single byte non-ASCII character, e.g. half width kana in sjis */ - continue; - } -#endif - - /* Wrong byte sequence */ - *error= 1; - break; - } - return b - b0; -} - -#endif /* DEFINE_WELL_FORMED_LEN */ - +#endif /* DEFINE_CHARLEN */ #ifdef DEFINE_WELL_FORMED_CHAR_LENGTH diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 61d01cc6aef..3254be51740 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -71,15 +71,15 @@ size_t my_strnxfrmlen_simple(CHARSET_INFO *cs, size_t len) */ -size_t my_strnxfrm_simple(CHARSET_INFO * cs, - uchar *dst, size_t dstlen, uint nweights, - const uchar *src, size_t srclen, uint flags) +size_t my_strnxfrm_simple_internal(CHARSET_INFO * cs, + uchar *dst, size_t dstlen, uint *nweights, + const uchar *src, size_t srclen) { const uchar *map= cs->sort_order; uchar *d0= dst; uint frmlen; - if ((frmlen= MY_MIN(dstlen, nweights)) > srclen) - frmlen= srclen; + if ((frmlen= (uint)MY_MIN(dstlen, *nweights)) > srclen) + frmlen= (uint)srclen; if (dst != src) { const uchar *end; @@ -92,8 +92,32 @@ size_t my_strnxfrm_simple(CHARSET_INFO * cs, for (end= dst + frmlen; dst < end; dst++) *dst= map[(uchar) *dst]; } + *nweights-= frmlen; + return dst - d0; +} + + +size_t my_strnxfrm_simple(CHARSET_INFO * cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + dst= d0 + my_strnxfrm_simple_internal(cs, dst, dstlen, &nweights, + src, srclen); return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, d0 + dstlen, - nweights - frmlen, flags, 0); + nweights, flags, 0); +} + + +size_t my_strnxfrm_simple_nopad(CHARSET_INFO * cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + dst= d0 + my_strnxfrm_simple_internal(cs, dst, dstlen, &nweights, + src, srclen); + return my_strxfrm_pad_desc_and_reverse_nopad(cs, d0, dst, d0 + dstlen, + nweights, flags, 0); } @@ -128,9 +152,6 @@ int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, size_t slen, a_length Length of 'a' b Second string to compare b_length Length of 'b' - diff_if_only_endspace_difference - Set to 1 if the strings should be regarded as different - if they only difference in end space IMPLEMENTATION If one string is shorter as the other, then we space extend the other @@ -149,17 +170,12 @@ int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, size_t slen, */ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, - const uchar *b, size_t b_length, - my_bool diff_if_only_endspace_difference) + const uchar *b, size_t b_length) { const uchar *map= cs->sort_order, *end; size_t length; int res; -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif - end= a + (length= MY_MIN(a_length, b_length)); while (a < end) { @@ -170,8 +186,6 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, if (a_length != b_length) { int swap= 1; - if (diff_if_only_endspace_difference) - res= 1; /* Assume 'a' is bigger */ /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -194,6 +208,14 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, } +int my_strnncollsp_simple_nopad(CHARSET_INFO * cs, + const uchar *a, size_t a_length, + const uchar *b, size_t b_length) +{ + return my_strnncoll_simple(cs, a, a_length, b, b_length, FALSE); +} + + size_t my_caseup_str_8bit(CHARSET_INFO * cs,char *str) { register const uchar *map= cs->to_upper; @@ -297,7 +319,7 @@ size_t my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)), const char* fmt, ...) { va_list args; - int result; + size_t result; va_start(args,fmt); result= my_vsnprintf(to, n, fmt, args); va_end(args); @@ -305,13 +327,28 @@ size_t my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)), } +void my_hash_sort_simple_nopad(CHARSET_INFO *cs, + const uchar *key, size_t len, + ulong *nr1, ulong *nr2) +{ + register const uchar *sort_order=cs->sort_order; + const uchar *end= key + len; + register ulong m1= *nr1, m2= *nr2; + for (; key < (uchar*) end ; key++) + { + MY_HASH_ADD(m1, m2, (uint) sort_order[(uint) *key]); + } + *nr1= m1; + *nr2= m2; +} + + void my_hash_sort_simple(CHARSET_INFO *cs, - const uchar *key, size_t len, - ulong *nr1, ulong *nr2) + const uchar *key, size_t len, + ulong *nr1, ulong *nr2) { register const uchar *sort_order=cs->sort_order; const uchar *end; - register ulong m1= *nr1, m2= *nr2; uint16 space_weight= sort_order[' ']; /* @@ -346,13 +383,7 @@ void my_hash_sort_simple(CHARSET_INFO *cs, break; } } - - for (; key < (uchar*) end ; key++) - { - MY_HASH_ADD(m1, m2, (uint) sort_order[(uint) *key]); - } - *nr1= m1; - *nr2= m2; + my_hash_sort_simple_nopad(cs, key, end - key, nr1, nr2); } @@ -1026,9 +1057,9 @@ my_bool my_like_range_simple(CHARSET_INFO *cs, if (*ptr == w_many) /* '%' in SQL */ { /* Calculate length of keys */ - *min_length= ((cs->state & MY_CS_BINSORT) ? + *min_length= (cs->state & (MY_CS_BINSORT | MY_CS_NOPAD)) ? (size_t) (min_str - min_org) : - res_length); + res_length; *max_length= res_length; do { @@ -1067,6 +1098,13 @@ size_t my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq) break; } return (size_t) (str - str0); + case MY_SEQ_NONSPACES: + for ( ; str < end ; str++) + { + if (my_isspace(cs, *str)) + break; + } + return (size_t) (str - str0); default: return 0; } @@ -1103,16 +1141,6 @@ size_t my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)), } -size_t my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)), - const char *start, const char *end, - size_t nchars, int *error) -{ - size_t nbytes= (size_t) (end-start); - *error= 0; - return MY_MIN(nbytes, nchars); -} - - size_t my_well_formed_char_length_8bit(CHARSET_INFO *cs __attribute__((unused)), const char *start, const char *end, @@ -1196,13 +1224,13 @@ skip: if (nmatch > 0) { match[0].beg= 0; - match[0].end= (size_t) (str- (const uchar*)b-1); + match[0].end= (uint) (str- (const uchar*)b-1); match[0].mb_len= match[0].end; if (nmatch > 1) { match[1].beg= match[0].end; - match[1].end= match[0].end+s_length; + match[1].end= (uint)(match[0].end+s_length); match[1].mb_len= match[1].end-match[1].beg; } } @@ -1341,12 +1369,85 @@ create_fromuni(struct charset_info_st *cs, return FALSE; } + +/* + Detect if a character set is 8bit, + and it is pure ascii, i.e. doesn't have + characters outside U+0000..U+007F + This functions is shared between "conf_to_src" + and dynamic charsets loader in "mysqld". +*/ +static my_bool +my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs) +{ + size_t code; + if (!cs->tab_to_uni) + return 0; + for (code= 0; code < 256; code++) + { + if (cs->tab_to_uni[code] > 0x7F) + return 0; + } + return 1; +} + + +/* + Shared function between conf_to_src and mysys. + Check if a 8bit character set is compatible with + ascii on the range 0x00..0x7F. +*/ +static my_bool +my_charset_is_ascii_compatible(CHARSET_INFO *cs) +{ + uint i; + if (!cs->tab_to_uni) + return 1; + for (i= 0; i < 128; i++) + { + if (cs->tab_to_uni[i] != i) + return 0; + } + return 1; +} + + +uint my_8bit_charset_flags_from_data(CHARSET_INFO *cs) +{ + uint flags= 0; + if (my_charset_is_8bit_pure_ascii(cs)) + flags|= MY_CS_PUREASCII; + if (!my_charset_is_ascii_compatible(cs)) + flags|= MY_CS_NONASCII; + return flags; +} + + +/* + Check if case sensitive sort order: A < a < B. + We need MY_CS_FLAG for regex library, and for + case sensitivity flag for 5.0 client protocol, + to support isCaseSensitive() method in JDBC driver +*/ +uint my_8bit_collation_flags_from_data(CHARSET_INFO *cs) +{ + uint flags= 0; + if (cs->sort_order && cs->sort_order['A'] < cs->sort_order['a'] && + cs->sort_order['a'] < cs->sort_order['B']) + flags|= MY_CS_CSSORT; + return flags; +} + + static my_bool my_cset_init_8bit(struct charset_info_st *cs, MY_CHARSET_LOADER *loader) { + cs->state|= my_8bit_charset_flags_from_data(cs); cs->caseup_multiply= 1; cs->casedn_multiply= 1; cs->pad_char= ' '; + if (!cs->to_lower || !cs->to_upper || !cs->ctype || !cs->tab_to_uni) + return TRUE; return create_fromuni(cs, loader); } @@ -1372,6 +1473,9 @@ static void set_max_sort_char(struct charset_info_st *cs) static my_bool my_coll_init_simple(struct charset_info_st *cs, MY_CHARSET_LOADER *loader __attribute__((unused))) { + if (!cs->sort_order) + return TRUE; + cs->state|= my_8bit_collation_flags_from_data(cs); set_max_sort_char(cs); return FALSE; } @@ -1598,7 +1702,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), /* Unknown character, exit the loop */ break; } - shift= dot ? dot - str : 0; /* Right shift */ + shift= dot ? (int)(dot - str) : 0; /* Right shift */ addon= 0; exp: /* [ E [ <sign> ] <unsigned integer> ] */ @@ -1924,7 +2028,7 @@ my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs, my_strxfrm_desc_and_reverse(str, frmend, flags, level); if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend) { - uint fill_length= strend - frmend; + size_t fill_length= strend - frmend; cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char); frmend= strend; } @@ -1932,14 +2036,33 @@ my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs, } +size_t +my_strxfrm_pad_desc_and_reverse_nopad(CHARSET_INFO *cs, + uchar *str, uchar *frmend, uchar *strend, + uint nweights, uint flags, uint level) +{ + if (nweights && frmend < strend && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + uint fill_length= MY_MIN((uint) (strend - frmend), nweights * cs->mbminlen); + memset(frmend, 0x00, fill_length); + frmend+= fill_length; + } + my_strxfrm_desc_and_reverse(str, frmend, flags, level); + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend) + { + size_t fill_length= strend - frmend; + memset(frmend, 0x00, fill_length); + frmend= strend; + } + return frmend - str; +} + + MY_CHARSET_HANDLER my_charset_8bit_handler= { my_cset_init_8bit, - NULL, /* ismbchar */ - my_mbcharlen_8bit, /* mbcharlen */ my_numchars_8bit, my_charpos_8bit, - my_well_formed_len_8bit, my_lengthsp_8bit, my_numcells_8bit, my_mb_wc_8bit, @@ -1981,3 +2104,19 @@ MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler = my_hash_sort_simple, my_propagate_simple }; + + +MY_COLLATION_HANDLER my_collation_8bit_simple_nopad_ci_handler = +{ + my_coll_init_simple, /* init */ + my_strnncoll_simple, + my_strnncollsp_simple_nopad, + my_strnxfrm_simple_nopad, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_8bit, + my_strcasecmp_8bit, + my_instr_simple, + my_hash_sort_simple_nopad, + my_propagate_simple +}; diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index f0f005685fe..902034b435d 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -192,18 +192,6 @@ static const uchar sort_order_sjis[]= #include "ctype-mb.ic" -static uint ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0); -} - -static uint mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c) -{ - return (issjishead((uchar) c) ? 2 : 1); -} - - #define sjiscode(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d)) @@ -34037,6 +34025,22 @@ size_t my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)), #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _sjis_japanese_nopad_ci +#define WEIGHT_PAD_SPACE (256 * (int) ' ') +#define WEIGHT_MB1(x) (256 * (int) sort_order_sjis[(uchar) (x)]) +#define WEIGHT_MB2(x,y) (sjiscode(x, y)) +#include "strcoll.ic" + + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _sjis_nopad_bin +#define WEIGHT_PAD_SPACE (256 * (int) ' ') +#define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) +#define WEIGHT_MB2(x,y) (sjiscode(x, y)) +#include "strcoll.ic" + + static MY_COLLATION_HANDLER my_collation_handler_sjis_japanese_ci= { NULL, /* init */ @@ -34069,14 +34073,43 @@ static MY_COLLATION_HANDLER my_collation_handler_sjis_bin= }; +static MY_COLLATION_HANDLER my_collation_handler_sjis_japanese_nopad_ci= +{ + NULL, /* init */ + my_strnncoll_sjis_japanese_ci, + my_strnncollsp_sjis_japanese_nopad_ci, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb, + my_strcasecmp_8bit, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_handler_sjis_nopad_bin= +{ + NULL, /* init */ + my_strnncoll_sjis_bin, + my_strnncollsp_sjis_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - ismbchar_sjis, - mbcharlen_sjis, my_numchars_mb, my_charpos_mb, - my_well_formed_len_sjis, my_lengthsp_8bit, my_numcells_sjis, my_mb_wc_sjis, /* mb_wc */ @@ -34169,4 +34202,69 @@ struct charset_info_st my_charset_sjis_bin= &my_collation_handler_sjis_bin }; + +struct charset_info_st my_charset_sjis_japanese_nopad_ci= +{ + MY_NOPAD_ID(13),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NONASCII|MY_CS_NOPAD, /* state */ + "sjis", /* cs name */ + "sjis_japanese_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_sjis, + to_lower_sjis, + to_upper_sjis, + sort_order_sjis, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_sjis, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFCFC, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_sjis_japanese_nopad_ci +}; + +struct charset_info_st my_charset_sjis_nopad_bin= +{ + MY_NOPAD_ID(88),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII|MY_CS_NOPAD, /* state */ + "sjis", /* cs name */ + "sjis_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_sjis, + to_lower_sjis, + to_upper_sjis, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_sjis, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFCFC, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_handler_sjis_nopad_bin +}; + #endif diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 5284109b816..bfd8b0db1d5 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -449,7 +449,7 @@ static const uchar sort_order_tis620[]= static size_t thai2sortable(uchar *tstr, size_t len) { uchar *p; - int tlen; + size_t tlen; uchar l2bias; tlen= len; @@ -541,18 +541,13 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)), static int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), - const uchar *a0, size_t a_length, - const uchar *b0, size_t b_length, - my_bool diff_if_only_endspace_difference) + const uchar *a0, size_t a_length, + const uchar *b0, size_t b_length) { uchar buf[80], *end, *a, *b, *alloced= NULL; size_t length; int res= 0; -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif - a= buf; if ((a_length + b_length +2) > (int) sizeof(buf)) alloced= a= (uchar*) my_malloc(a_length+b_length+2, MYF(MY_FAE)); @@ -574,33 +569,12 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), goto ret; } } - if (a_length != b_length) - { - int swap= 1; - if (diff_if_only_endspace_difference) - res= 1; /* Assume 'a' is bigger */ - /* - Check the next not space character of the longer key. If it's < ' ', - then it's smaller than the other key. - */ - if (a_length < b_length) - { - /* put shorter key in s */ - a_length= b_length; - a= b; - swap= -1; /* swap sign of result */ - res= -res; - } - for (end= a + a_length-length; a < end ; a++) - { - if (*a != ' ') - { - res= (*a < ' ') ? -swap : swap; - goto ret; - } - } - } - + + res= a_length == b_length ? 0 : + a_length < b_length ? + -my_strnncollsp_padspace_bin(b, b_length - length) : + my_strnncollsp_padspace_bin(a, a_length - length); + ret: if (alloced) @@ -609,6 +583,13 @@ ret: } +static +int my_strnncollsp_tis620_nopad(CHARSET_INFO * cs __attribute__((unused)), + const uchar *a0, size_t a_length, + const uchar *b0, size_t b_length) +{ + return my_strnncoll_tis620(cs, a0, a_length, b0, b_length, FALSE); +} /* strnxfrm replacment, convert Thai string to sortable string @@ -628,10 +609,10 @@ my_strnxfrm_tis620(CHARSET_INFO *cs, set_if_smaller(dstlen, nweights); set_if_smaller(len, dstlen); len= my_strxfrm_pad_desc_and_reverse(cs, dst, dst + len, dst + dstlen, - dstlen - len, flags, 0); + (uint)(dstlen - len), flags, 0); if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len < dstlen0) { - uint fill_length= dstlen0 - len; + size_t fill_length= dstlen0 - len; cs->cset->fill(cs, (char*) dst + len, fill_length, cs->pad_char); len= dstlen0; } @@ -639,6 +620,29 @@ my_strnxfrm_tis620(CHARSET_INFO *cs, } +static size_t +my_strnxfrm_tis620_nopad(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + size_t len, dstlen0= dstlen; + len= (uint) (strmake((char*) dst, (char*) src, MY_MIN(dstlen, srclen)) - + (char*) dst); + len= thai2sortable(dst, len); + set_if_smaller(dstlen, nweights); + set_if_smaller(len, dstlen); + len= my_strxfrm_pad_desc_and_reverse_nopad(cs, dst, dst + len, dst + dstlen, + (uint)(dstlen - len), flags, 0); + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len < dstlen0) + { + size_t fill_length= dstlen0 - len; + memset(dst + len, 0x00, fill_length); + len= dstlen0; + } + return len; +} + + static const unsigned short cs_to_uni[256]={ 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, @@ -856,14 +860,26 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = my_propagate_simple }; +static MY_COLLATION_HANDLER my_collation_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_tis620, + my_strnncollsp_tis620_nopad, + my_strnxfrm_tis620_nopad, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_8bit, /* wildcmp */ + my_strcasecmp_8bit, + my_instr_simple, /* QQ: To be fixed */ + my_hash_sort_simple_nopad, + my_propagate_simple +}; + static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - NULL, /* ismbchar */ - my_mbcharlen_8bit, /* mbcharlen */ my_numchars_8bit, my_charpos_8bit, - my_well_formed_len_8bit, my_lengthsp_8bit, my_numcells_8bit, my_mb_wc_tis620, /* mb_wc */ @@ -958,4 +974,70 @@ struct charset_info_st my_charset_tis620_bin= }; +struct charset_info_st my_charset_tis620_thai_nopad_ci= +{ + MY_NOPAD_ID(18),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NON1TO1|MY_CS_NOPAD, /* state */ + "tis620", /* cs name */ + "tis620_thai_nopad_ci",/* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_tis620, + to_lower_tis620, + to_upper_tis620, + sort_order_tis620, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_nopad_ci_handler +}; + + +struct charset_info_st my_charset_tis620_nopad_bin= +{ + MY_NOPAD_ID(89),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "tis620", /* cs name */ + "tis620_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_tis620, + to_lower_tis620, + to_upper_tis620, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_8bit_nopad_bin_handler +}; + + #endif diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 84a44b28b45..b93913175e8 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -6542,6 +6542,17 @@ MY_UCA_INFO my_uca_v400= }, 0 /* levelno */ }, + { + 0, + NULL, + NULL, + { + 0, + NULL, + NULL + }, + 1 /* levelno */ + }, }, /* Logical positions */ @@ -30134,6 +30145,18 @@ MY_UCA_INFO my_uca_v520= }, 0 /* levelno */ }, + + { + 0x10FFFF, /* maxchar */ + (uchar *) uca520_length_w2, + (uint16 **) uca520_weight_w2, + { /* Contractions: */ + 0, /* nitems */ + NULL, /* item */ + NULL /* flags */ + }, + 1 /* levelno */ + }, }, 0x0009, /* first_non_ignorable p != ignore */ @@ -31237,7 +31260,7 @@ static my_bool my_uca_alloc_contractions(MY_CONTRACTIONS *contractions, MY_CHARSET_LOADER *loader, size_t n) { - uint size= n * sizeof(MY_CONTRACTION); + size_t size= n * sizeof(MY_CONTRACTION); if (!(contractions->item= (loader->once_alloc)(size)) || !(contractions->flags= (char *) (loader->once_alloc)(MY_UCA_CNT_FLAG_SIZE))) return 1; @@ -31465,7 +31488,7 @@ my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc) size_t clen= 1; int flag; const uchar *s, *beg[MY_UCA_MAX_CONTRACTION]; - memset(beg, 0, sizeof(beg)); + memset((void*) beg, 0, sizeof(beg)); /* Scan all contraction candidates */ for (s= scanner->sbeg, flag= MY_UCA_CNT_MID1; @@ -31587,7 +31610,7 @@ my_uca_implicit_weight_put(uint16 *to, my_wc_t code, uint level) break; } /* Primary level */ - to[0]= (code >> 15) + my_uca_implicit_weight_base(code); + to[0]= (uint16)(code >> 15) + my_uca_implicit_weight_base(code); to[1]= (code & 0x7FFF) | 0x8000; to[2]= 0; } @@ -31851,6 +31874,25 @@ static int my_strnncoll_uca_multilevel(CHARSET_INFO *cs, } +static int +my_strnncollsp_generic_uca_nopad_multilevel(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen) +{ + uint num_level= cs->levels_for_order; + uint i; + for (i= 0; i != num_level; i++) + { + int ret= my_strnncoll_uca_onelevel(cs, &my_any_uca_scanner_handler, + &cs->uca->level[i], + s, slen, t, tlen, FALSE); + if (ret) + return ret; + } + return 0; +} + + static inline int my_space_weight(const MY_UCA_WEIGHT_LEVEL *level) { @@ -31894,9 +31936,6 @@ my_char_weight_addr(const MY_UCA_WEIGHT_LEVEL *level, uint wc) t Second string tlen Seconf string length level DUCETweight level - diff_if_only_endspace_difference - Set to 1 if the strings should be regarded as different - if they only difference in end space NOTES: Works exactly the same with my_strnncoll_uca(), @@ -31935,16 +31974,11 @@ static int my_strnncollsp_uca_onelevel(CHARSET_INFO *cs, my_uca_scanner_handler *scanner_handler, const MY_UCA_WEIGHT_LEVEL *level, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference) + const uchar *t, size_t tlen) { my_uca_scanner sscanner, tscanner; int s_res, t_res; -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif - scanner_handler->init(&sscanner, cs, level, s, slen); scanner_handler->init(&tscanner, cs, level, t, tlen); @@ -31966,7 +32000,7 @@ static int my_strnncollsp_uca_onelevel(CHARSET_INFO *cs, return (s_res - t_res); s_res= scanner_handler->next(&sscanner); } while (s_res > 0); - return diff_if_only_endspace_difference ? 1 : 0; + return 0; } if (s_res < 0 && t_res > 0) @@ -31981,7 +32015,7 @@ static int my_strnncollsp_uca_onelevel(CHARSET_INFO *cs, return (s_res - t_res); t_res= scanner_handler->next(&tscanner); } while (t_res > 0); - return diff_if_only_endspace_difference ? -1 : 0; + return 0; } return ( s_res - t_res ); @@ -31990,28 +32024,23 @@ static int my_strnncollsp_uca_onelevel(CHARSET_INFO *cs, static int my_strnncollsp_uca(CHARSET_INFO *cs, my_uca_scanner_handler *scanner_handler, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference) + const uchar *t, size_t tlen) { return my_strnncollsp_uca_onelevel(cs, scanner_handler, &cs->uca->level[0], - s, slen, t, tlen, - diff_if_only_endspace_difference); + s, slen, t, tlen); } static int my_strnncollsp_uca_multilevel(CHARSET_INFO *cs, my_uca_scanner_handler *scanner_handler, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference) + const uchar *t, size_t tlen) { uint num_level= cs->levels_for_order; uint i; for (i= 0; i != num_level; i++) { int ret= my_strnncollsp_uca_onelevel(cs, scanner_handler, - &cs->uca->level[i], - s, slen, t, tlen, - diff_if_only_endspace_difference); + &cs->uca->level[i], s, slen, t, tlen); if (ret) return ret; } @@ -32101,36 +32130,126 @@ end: } +static void my_hash_sort_uca_nopad(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) +{ + int s_res; + my_uca_scanner scanner; + register ulong m1= *nr1, m2= *nr2; + + scanner_handler->init(&scanner, cs, &cs->uca->level[0], s, slen); + + while ((s_res= scanner_handler->next(&scanner)) >0) + { + /* See comment above why we can't use MY_HASH_ADD_16() */ + MY_HASH_ADD(m1, m2, s_res >> 8); + MY_HASH_ADD(m1, m2, s_res & 0xFF); + } + *nr1= m1; + *nr2= m2; +} + + static uchar * -my_strnxfrm_uca_onelevel(CHARSET_INFO *cs, - my_uca_scanner_handler *scanner_handler, - MY_UCA_WEIGHT_LEVEL *level, - uchar *dst, uchar *de, uint nweights, - const uchar *src, size_t srclen, uint flags) +my_strnxfrm_uca_onelevel_internal(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + MY_UCA_WEIGHT_LEVEL *level, + uchar *dst, uchar *de, uint *nweights, + const uchar *src, size_t srclen) { my_uca_scanner scanner; - uchar *d0= dst; int s_res; + DBUG_ASSERT(src || !srclen); + scanner_handler->init(&scanner, cs, level, src, srclen); - for (; dst < de && nweights && - (s_res= scanner_handler->next(&scanner)) > 0 ; nweights--) + for (; dst < de && *nweights && + (s_res= scanner_handler->next(&scanner)) > 0 ; (*nweights)--) { *dst++= s_res >> 8; if (dst < de) *dst++= s_res & 0xFF; } + return dst; +} + + +static uchar * +my_strnxfrm_uca_padn(uchar *dst, uchar *de, uint nweights, int weight) +{ + uint count= MY_MIN((uint) (de - dst) / 2, nweights); + for (; count ; count--) + { + *dst++= weight >> 8; + *dst++= weight & 0xFF; + } + return dst; +} - if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + +static uchar * +my_strnxfrm_uca_pad(uchar *dst, uchar *de, int weight) +{ + for ( ; dst < de; ) { - uint space_count= MY_MIN((uint) (de - dst) / 2, nweights); - s_res= my_space_weight(level); - for (; space_count ; space_count--) - { - *dst++= s_res >> 8; - *dst++= s_res & 0xFF; - } + *dst++= weight >> 8; + if (dst < de) + *dst++= weight & 0xFF; } + return dst; +} + + +static uchar * +my_strnxfrm_uca_onelevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + MY_UCA_WEIGHT_LEVEL *level, + uchar *dst, uchar *de, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + + dst= my_strnxfrm_uca_onelevel_internal(cs, scanner_handler, level, + dst, de, &nweights, + src, srclen); + DBUG_ASSERT(dst <= de); + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + dst= my_strnxfrm_uca_padn(dst, de, nweights, my_space_weight(level)); + DBUG_ASSERT(dst <= de); + my_strxfrm_desc_and_reverse(d0, dst, flags, 0); + return dst; +} + + +/* + Return the minimum possible weight on a level. +*/ +static uint min_weight_on_level(MY_UCA_WEIGHT_LEVEL *level) +{ + DBUG_ASSERT(level->levelno < 2); /* No 3-level NOPAD collations yet */ + return level->levelno == 0 ? 0x0200 : 0x0020; +} + + +static uchar * +my_strnxfrm_uca_nopad_onelevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + MY_UCA_WEIGHT_LEVEL *level, + uchar *dst, uchar *de, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + + dst= my_strnxfrm_uca_onelevel_internal(cs, scanner_handler, level, + dst, de, &nweights, + src, srclen); + DBUG_ASSERT(dst <= de); + /* Pad with the minimum possible weight on this level */ + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + dst= my_strnxfrm_uca_padn(dst, de, nweights, min_weight_on_level(level)); + DBUG_ASSERT(dst <= de); my_strxfrm_desc_and_reverse(d0, dst, flags, 0); return dst; } @@ -32184,14 +32303,26 @@ my_strnxfrm_uca(CHARSET_INFO *cs, like my_strnxfrm_uca_multilevel() does. */ if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) + dst= my_strnxfrm_uca_pad(dst, de, my_space_weight(&cs->uca->level[0])); + return dst - d0; +} + + +static size_t +my_strnxfrm_uca_nopad(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + uchar *de= dst + dstlen; + + dst= my_strnxfrm_uca_nopad_onelevel(cs, scanner_handler, &cs->uca->level[0], + dst, de, nweights, src, srclen, flags); + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) { - int s_res= my_space_weight(&cs->uca->level[0]); - for ( ; dst < de; ) - { - *dst++= s_res >> 8; - if (dst < de) - *dst++= s_res & 0xFF; - } + memset(dst, 0, de - dst); + dst= de; } return dst - d0; } @@ -32212,7 +32343,12 @@ my_strnxfrm_uca_multilevel(CHARSET_INFO *cs, { if (!(flags & MY_STRXFRM_LEVEL_ALL) || (flags & (MY_STRXFRM_LEVEL1 << current_level))) - dst= my_strnxfrm_uca_onelevel(cs, scanner_handler, + dst= cs->state & MY_CS_NOPAD ? + my_strnxfrm_uca_nopad_onelevel(cs, scanner_handler, + &cs->uca->level[current_level], + dst, de, nweights, + src, srclen, flags) : + my_strnxfrm_uca_onelevel(cs, scanner_handler, &cs->uca->level[current_level], dst, de, nweights, src, srclen, flags); @@ -32890,6 +33026,7 @@ typedef enum typedef struct my_coll_rules_st { uint version; /* Unicode version, e.g. 400 or 520 */ + uint strength; /* Number of levels */ MY_UCA_INFO *uca; /* Unicode weight data */ size_t nrules; /* Number of rules in the rule array */ size_t mrules; /* Number of allocated rules */ @@ -33171,6 +33308,10 @@ my_coll_parser_scan_setting(MY_COLL_RULE_PARSER *p) { rules->shift_after_method= my_shift_method_simple; } + else if (!lex_cmp(lexem, C_STRING_WITH_LEN("[strength 1]"))) + rules->strength= 1; + else if (!lex_cmp(lexem, C_STRING_WITH_LEN("[strength 2]"))) + rules->strength= 2; else { return 0; @@ -33866,7 +34007,7 @@ apply_one_rule(MY_CHARSET_LOADER *loader, { MY_CONTRACTIONS *contractions= &dst->contractions; to= my_uca_init_one_contraction(contractions, - r->curr, nshift, r->with_context); + r->curr, (uint)nshift, r->with_context); /* Store weights of the "reset to" character */ dst->contractions.nitems--; /* Temporarily hide - it's incomplete */ rc= my_char_weight_put(dst, @@ -34063,9 +34204,9 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, ncontractions++; } - ncontractions += src->contractions.nitems; + ncontractions += (int)src->contractions.nitems; - if ((my_uca_generate_pages(loader, dst, src, npages))) + if ((my_uca_generate_pages(loader, dst, src, (uint)npages))) return TRUE; if (ncontractions) @@ -34109,6 +34250,10 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, } +MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel; +MY_COLLATION_HANDLER my_collation_generic_uca_nopad_handler_multilevel; + + /* This function copies an UCS2 collation from the default Unicode Collation Algorithm (UCA) @@ -34133,66 +34278,6 @@ create_tailoring(struct charset_info_st *cs, MY_COLL_RULES rules; MY_UCA_INFO new_uca, *src_uca= NULL; int rc= 0; - - *loader->error= '\0'; - - if (!cs->tailoring) - return 0; /* Ok to add a collation without tailoring */ - - memset(&rules, 0, sizeof(rules)); - rules.loader= loader; - rules.uca= cs->uca ? cs->uca : &my_uca_v400; /* For logical positions, etc */ - memset(&new_uca, 0, sizeof(new_uca)); - - /* Parse ICU Collation Customization expression */ - if ((rc= my_coll_rule_parse(&rules, - cs->tailoring, - cs->tailoring + strlen(cs->tailoring)))) - goto ex; - - if (rules.version == 520) /* Unicode-5.2.0 requested */ - { - src_uca= &my_uca_v520; - cs->caseinfo= &my_unicase_unicode520; - } - else if (rules.version == 400) /* Unicode-4.0.0 requested */ - { - src_uca= &my_uca_v400; - cs->caseinfo= &my_unicase_default; - } - else /* No Unicode version specified */ - { - src_uca= cs->uca ? cs->uca : &my_uca_v400; - if (!cs->caseinfo) - cs->caseinfo= &my_unicase_default; - } - - if ((rc= init_weight_level(loader, &rules, - &new_uca.level[0], &src_uca->level[0]))) - goto ex; - - if (!(cs->uca= (MY_UCA_INFO *) (loader->once_alloc)(sizeof(MY_UCA_INFO)))) - { - rc= 1; - goto ex; - } - cs->uca[0]= new_uca; - -ex: - (loader->free)(rules.rule); - if (rc != 0 && loader->error[0]) - loader->reporter(ERROR_LEVEL, "%s", loader->error); - return rc; -} - -static my_bool -create_tailoring_multilevel(struct charset_info_st *cs, - MY_CHARSET_LOADER *loader) -{ - uint num_level= cs->levels_for_order; - MY_COLL_RULES rules; - MY_UCA_INFO new_uca, *src_uca= NULL; - int rc= 0; uint i; *loader->error= '\0'; @@ -34227,9 +34312,17 @@ create_tailoring_multilevel(struct charset_info_st *cs, if (!cs->caseinfo) cs->caseinfo= &my_unicase_default; } + cs->levels_for_order= rules.strength ? rules.strength : 1; - for (i= 0; i != num_level; i++) + for (i= 0; i != cs->levels_for_order; i++) { + if ((rc= (src_uca->level[i].maxchar == 0))) + { + my_snprintf(loader->error, sizeof(loader->error) - 1, + "%s: no level #%d data for this Unicode version.", + cs->name, i + 1); + goto ex; + } if ((rc= init_weight_level(loader, &rules, &new_uca.level[i], &src_uca->level[i]))) goto ex; @@ -34241,6 +34334,10 @@ create_tailoring_multilevel(struct charset_info_st *cs, goto ex; } cs->uca[0]= new_uca; + if (cs->levels_for_order > 1) + cs->coll= (cs->state & MY_CS_NOPAD) ? + &my_collation_generic_uca_nopad_handler_multilevel : + &my_collation_any_uca_handler_multilevel; ex: (loader->free)(rules.rule); @@ -34265,16 +34362,6 @@ my_coll_init_uca(struct charset_info_st *cs, MY_CHARSET_LOADER *loader) return create_tailoring(cs, loader); } -static my_bool -my_coll_init_uca_multilevel(struct charset_info_st *cs, - MY_CHARSET_LOADER *loader) -{ - cs->pad_char= ' '; - cs->ctype= my_charset_utf8_unicode_ci.ctype; - if (!cs->caseinfo) - cs->caseinfo= &my_unicase_default; - return create_tailoring_multilevel(cs, loader); -} static int my_strnncoll_any_uca(CHARSET_INFO *cs, const uchar *s, size_t slen, @@ -34296,22 +34383,27 @@ static int my_strnncoll_any_uca_multilevel(CHARSET_INFO *cs, static int my_strnncollsp_any_uca(CHARSET_INFO *cs, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference) + const uchar *t, size_t tlen) { - return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler, - s, slen, t, tlen, - diff_if_only_endspace_difference); + return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler, s, slen, t, tlen); +} + + +static int my_strnncollsp_generic_uca_nopad(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen) +{ + return my_strnncoll_uca(cs, &my_any_uca_scanner_handler, + s, slen, t, tlen, FALSE); } + static int my_strnncollsp_any_uca_multilevel(CHARSET_INFO *cs, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference) + const uchar *t, size_t tlen) { return my_strnncollsp_uca_multilevel(cs, &my_any_uca_scanner_handler, - s, slen, t, tlen, - diff_if_only_endspace_difference); + s, slen, t, tlen); } static void my_hash_sort_any_uca(CHARSET_INFO *cs, @@ -34321,6 +34413,13 @@ static void my_hash_sort_any_uca(CHARSET_INFO *cs, my_hash_sort_uca(cs, &my_any_uca_scanner_handler, s, slen, n1, n2); } +static void my_hash_sort_generic_uca_nopad(CHARSET_INFO *cs, + const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_hash_sort_uca_nopad(cs, &my_any_uca_scanner_handler, s, slen, n1, n2); +} + static size_t my_strnxfrm_any_uca(CHARSET_INFO *cs, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags) @@ -34329,6 +34428,16 @@ static size_t my_strnxfrm_any_uca(CHARSET_INFO *cs, dst, dstlen, nweights, src, srclen, flags); } +static size_t my_strnxfrm_generic_uca_nopad(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, + uint nweights, + const uchar *src, size_t srclen, + uint flags) +{ + return my_strnxfrm_uca_nopad(cs, &my_any_uca_scanner_handler, + dst, dstlen, nweights, src, srclen, flags); +} + static size_t my_strnxfrm_any_uca_multilevel(CHARSET_INFO *cs, uchar *dst, size_t dstlen, uint nweights, const uchar *src, @@ -34351,9 +34460,43 @@ static size_t my_strnxfrmlen_any_uca_multilevel(CHARSET_INFO *cs, size_t len) } +/* NO PAD handler for character sets with mbminlen==1 */ +MY_COLLATION_HANDLER my_collation_mb_uca_nopad_handler = +{ + my_coll_init_uca, + my_strnncoll_any_uca, + my_strnncollsp_generic_uca_nopad, + my_strnxfrm_generic_uca_nopad, + my_strnxfrmlen_any_uca, + my_like_range_mb, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_generic_uca_nopad, + my_propagate_complex +}; + + +/* NO PAD handler for character sets with mbminlen>=1 */ +MY_COLLATION_HANDLER my_collation_generic_uca_nopad_handler = +{ + my_coll_init_uca, + my_strnncoll_any_uca, + my_strnncollsp_generic_uca_nopad, + my_strnxfrm_generic_uca_nopad, + my_strnxfrmlen_any_uca, + my_like_range_generic, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_generic_uca_nopad, + my_propagate_complex +}; + + MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel= { - my_coll_init_uca_multilevel, + my_coll_init_uca, my_strnncoll_any_uca_multilevel, my_strnncollsp_any_uca_multilevel, my_strnxfrm_any_uca_multilevel, @@ -34367,6 +34510,22 @@ MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel= }; +MY_COLLATION_HANDLER my_collation_generic_uca_nopad_handler_multilevel = +{ + my_coll_init_uca, + my_strnncoll_any_uca_multilevel, + my_strnncollsp_generic_uca_nopad_multilevel, + my_strnxfrm_any_uca_multilevel, + my_strnxfrmlen_any_uca_multilevel, + my_like_range_generic, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_generic_uca_nopad, + my_propagate_complex +}; + + #ifdef HAVE_CHARSET_ucs2 /* UCS2 optimized CHARSET_INFO compatible wrappers. @@ -34382,12 +34541,9 @@ static int my_strnncoll_ucs2_uca(CHARSET_INFO *cs, static int my_strnncollsp_ucs2_uca(CHARSET_INFO *cs, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference) + const uchar *t, size_t tlen) { - return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler, - s, slen, t, tlen, - diff_if_only_endspace_difference); + return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler, s, slen, t, tlen); } static void my_hash_sort_ucs2_uca(CHARSET_INFO *cs, @@ -34420,7 +34576,9 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler = my_propagate_complex }; + #define MY_CS_UCS2_UCA_FLAGS (MY_CS_COMMON_UCA_FLAGS|MY_CS_NONASCII) +#define MY_CS_UCS2_UCA_NOPAD_FLAGS (MY_CS_UCS2_UCA_FLAGS|MY_CS_NOPAD) struct charset_info_st my_charset_ucs2_unicode_ci= { @@ -35207,7 +35365,7 @@ struct charset_info_st my_charset_ucs2_thai_520_w2= "ucs2", /* csname */ "ucs2_thai_520_w2", /* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ NULL, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -35298,6 +35456,72 @@ struct charset_info_st my_charset_ucs2_vietnamese_ci= }; +struct charset_info_st my_charset_ucs2_unicode_nopad_ci= +{ + MY_NOPAD_ID(128),0,0, /* number */ + MY_CS_UCS2_UCA_NOPAD_FLAGS,/* state */ + "ucs2", /* cs name */ + "ucs2_unicode_nopad_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_generic_uca_nopad_handler +}; + + +struct charset_info_st my_charset_ucs2_unicode_520_nopad_ci= +{ + MY_NOPAD_ID(150),0,0, /* number */ + MY_CS_UCS2_UCA_NOPAD_FLAGS, /* state */ + "ucs2", /* cs name */ + "ucs2_unicode_520_nopad_ci",/* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_generic_uca_nopad_handler +}; + + #endif @@ -35317,6 +35541,7 @@ MY_COLLATION_HANDLER my_collation_any_uca_handler = my_propagate_complex }; + /* We consider bytes with code more than 127 as a letter. This garantees that word boundaries work fine with regular @@ -35346,6 +35571,7 @@ static uchar ctype_utf8[] = { extern MY_CHARSET_HANDLER my_charset_utf8_handler; #define MY_CS_UTF8MB3_UCA_FLAGS MY_CS_COMMON_UCA_FLAGS +#define MY_CS_UTF8MB3_UCA_NOPAD_FLAGS (MY_CS_UTF8MB3_UCA_FLAGS|MY_CS_NOPAD) struct charset_info_st my_charset_utf8_unicode_ci= { @@ -36160,7 +36386,7 @@ struct charset_info_st my_charset_utf8_thai_520_w2= MY_UTF8MB3, /* csname */ MY_UTF8MB3 "_thai_520_w2",/* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ ctype_utf8, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -36218,6 +36444,71 @@ struct charset_info_st my_charset_utf8_vietnamese_ci= }; +struct charset_info_st my_charset_utf8_unicode_nopad_ci= +{ + MY_NOPAD_ID(192),0,0, /* number */ + MY_CS_UTF8MB3_UCA_NOPAD_FLAGS, /* flags */ + MY_UTF8MB3, /* cs name */ + MY_UTF8MB3 "_unicode_nopad_ci",/* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8_handler, + &my_collation_mb_uca_nopad_handler +}; + + +struct charset_info_st my_charset_utf8_unicode_520_nopad_ci= +{ + MY_NOPAD_ID(214),0,0, /* number */ + MY_CS_UTF8MB3_UCA_NOPAD_FLAGS, /* flags */ + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_unicode_520_nopad_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8_handler, + &my_collation_mb_uca_nopad_handler +}; + #endif /* HAVE_CHARSET_utf8 */ @@ -36226,6 +36517,7 @@ struct charset_info_st my_charset_utf8_vietnamese_ci= extern MY_CHARSET_HANDLER my_charset_utf8mb4_handler; #define MY_CS_UTF8MB4_UCA_FLAGS (MY_CS_COMMON_UCA_FLAGS|MY_CS_UNICODE_SUPPLEMENT) +#define MY_CS_UTF8MB4_UCA_NOPAD_FLAGS (MY_CS_UTF8MB4_UCA_FLAGS|MY_CS_NOPAD) struct charset_info_st my_charset_utf8mb4_unicode_ci= { @@ -37006,7 +37298,7 @@ struct charset_info_st my_charset_utf8mb4_thai_520_w2= MY_UTF8MB4, /* csname */ MY_UTF8MB4 "_thai_520_w2", /* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ ctype_utf8, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -37097,6 +37389,72 @@ struct charset_info_st my_charset_utf8mb4_vietnamese_ci= }; +struct charset_info_st my_charset_utf8mb4_unicode_nopad_ci= +{ + MY_NOPAD_ID(224),0,0, /* number */ + MY_CS_UTF8MB4_UCA_NOPAD_FLAGS, /* state */ + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_unicode_nopad_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_mb_uca_nopad_handler +}; + + +struct charset_info_st my_charset_utf8mb4_unicode_520_nopad_ci= +{ + MY_NOPAD_ID(246),0,0, /* number */ + MY_CS_UTF8MB4_UCA_NOPAD_FLAGS, /* flags */ + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_unicode_520_nopad_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0x10FFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_mb_uca_nopad_handler +}; + + #endif /* HAVE_CHARSET_utf8mb4 */ @@ -37117,9 +37475,11 @@ MY_COLLATION_HANDLER my_collation_utf32_uca_handler = my_propagate_complex }; + extern MY_CHARSET_HANDLER my_charset_utf32_handler; #define MY_CS_UTF32_UCA_FLAGS (MY_CS_COMMON_UCA_FLAGS|MY_CS_NONASCII) +#define MY_CS_UTF32_UCA_NOPAD_FLAGS (MY_CS_UTF32_UCA_FLAGS|MY_CS_NOPAD) struct charset_info_st my_charset_utf32_unicode_ci= { @@ -37900,7 +38260,7 @@ struct charset_info_st my_charset_utf32_thai_520_w2= "utf32", /* csname */ "utf32_thai_520_w2",/* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ NULL, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -37992,6 +38352,73 @@ struct charset_info_st my_charset_utf32_vietnamese_ci= }; +struct charset_info_st my_charset_utf32_unicode_nopad_ci= +{ + MY_NOPAD_ID(160),0,0, /* number */ + MY_CS_UTF32_UCA_NOPAD_FLAGS, /* state */ + "utf32", /* csname */ + "utf32_unicode_nopad_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_generic_uca_nopad_handler +}; + + +struct charset_info_st my_charset_utf32_unicode_520_nopad_ci= +{ + MY_NOPAD_ID(182),0,0, /* number */ + MY_CS_UTF32_UCA_NOPAD_FLAGS, /* state */ + "utf32", /* csname */ + "utf32_unicode_520_nopad_ci",/* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0x10FFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_generic_uca_nopad_handler +}; + + + #endif /* HAVE_CHARSET_utf32 */ @@ -38013,9 +38440,11 @@ MY_COLLATION_HANDLER my_collation_utf16_uca_handler = my_propagate_complex }; + extern MY_CHARSET_HANDLER my_charset_utf16_handler; #define MY_CS_UTF16_UCA_FLAGS (MY_CS_COMMON_UCA_FLAGS|MY_CS_NONASCII) +#define MY_CS_UTF16_UCA_NOPAD_FLAGS (MY_CS_UTF16_UCA_FLAGS|MY_CS_NOPAD) struct charset_info_st my_charset_utf16_unicode_ci= { @@ -38798,7 +39227,7 @@ struct charset_info_st my_charset_utf16_thai_520_w2= "utf16", /* cs name */ "utf16_thai_520_w2",/* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ NULL, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -38890,6 +39319,72 @@ struct charset_info_st my_charset_utf16_vietnamese_ci= }; +struct charset_info_st my_charset_utf16_unicode_nopad_ci= +{ + MY_NOPAD_ID(101),0,0, /* number */ + MY_CS_UTF16_UCA_NOPAD_FLAGS, /* state */ + "utf16", /* csname */ + "utf16_unicode_nopad_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_generic_uca_nopad_handler +}; + + +struct charset_info_st my_charset_utf16_unicode_520_nopad_ci= +{ + MY_NOPAD_ID(123),0,0, /* number */ + MY_CS_UTF16_UCA_NOPAD_FLAGS, /* state */ + "utf16", /* csname */ + "utf16_unicode_520_nopad_ci",/* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0x10FFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_generic_uca_nopad_handler +}; + + #endif /* HAVE_CHARSET_utf16 */ diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 754ec69ee9d..f229bbf7323 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1038,6 +1038,9 @@ my_scan_mb2(CHARSET_INFO *cs __attribute__((unused)), { } return (size_t) (str - str0); + case MY_SEQ_NONSPACES: + DBUG_ASSERT(0); /* Not implemented */ + /* pass through */ default: return 0; } @@ -1048,7 +1051,7 @@ static void my_fill_mb2(CHARSET_INFO *cs, char *s, size_t slen, int fill) { char buf[10], *last; - int buflen, remainder; + size_t buflen, remainder; DBUG_ASSERT((slen % 2) == 0); @@ -1063,7 +1066,7 @@ my_fill_mb2(CHARSET_INFO *cs, char *s, size_t slen, int fill) for (last= s + slen - buflen; s <= last; s+= buflen) { /* Enough space for the characer */ - memcpy(s, buf, (size_t) buflen); + memcpy(s, buf, buflen); } /* @@ -1075,7 +1078,7 @@ my_fill_mb2(CHARSET_INFO *cs, char *s, size_t slen, int fill) } -static int +static size_t my_vsnprintf_mb2(char *dst, size_t n, const char* fmt, va_list ap) { char *start=dst, *end= dst + n - 1; @@ -1176,10 +1179,13 @@ my_lengthsp_mb2(CHARSET_INFO *cs __attribute__((unused)), #endif /* HAVE_CHARSET_mb2*/ +/* + Next part is actually HAVE_CHARSET_utf16-specific, + but the JSON functions needed my_utf16_uni() + so the #ifdef was moved lower. +*/ -#ifdef HAVE_CHARSET_utf16 - /* D800..DB7F - Non-provate surrogate high (896 pages) DB80..DBFF - Private surrogate high (128 pages) @@ -1229,10 +1235,29 @@ static inline int my_weight_mb2_utf16mb2_general_ci(uchar b0, uchar b1) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b0, b1, b2, b3)) #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf16_general_nopad_ci +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b0,b1) +#define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER +#include "strcoll.ic" + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf16_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB2(b0,b1) ((int) MY_UTF16_WC2(b0, b1)) +#define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b0, b1, b2, b3)) +#include "strcoll.ic" + #undef IS_MB2_CHAR #undef IS_MB4_CHAR -static int +/* + These two functions are used in JSON library, so made exportable + and unconditionally compiled into the library. +*/ + +/*static*/ int my_utf16_uni(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e) { @@ -1265,7 +1290,7 @@ my_utf16_uni(CHARSET_INFO *cs __attribute__((unused)), } -static int +/*static*/ int my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)), my_wc_t wc, uchar *s, uchar *e) { @@ -1295,6 +1320,9 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)), } +#ifdef HAVE_CHARSET_utf16 + + static inline void my_tolower_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) { @@ -1357,13 +1385,14 @@ my_caseup_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, static void -my_hash_sort_utf16(CHARSET_INFO *cs, const uchar *s, size_t slen, - ulong *nr1, ulong *nr2) +my_hash_sort_utf16_nopad(CHARSET_INFO *cs, + const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) { my_wc_t wc; my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc; int res; - const uchar *e= s + cs->cset->lengthsp(cs, (const char *) s, slen); + const uchar *e= s + slen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; @@ -1378,6 +1407,15 @@ my_hash_sort_utf16(CHARSET_INFO *cs, const uchar *s, size_t slen, } +static void +my_hash_sort_utf16(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) +{ + size_t lengthsp= cs->cset->lengthsp(cs, (const char *) s, slen); + my_hash_sort_utf16_nopad(cs, s, lengthsp, nr1, nr2); +} + + static size_t my_casedn_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, char *dst, size_t dstlen) @@ -1404,15 +1442,6 @@ my_casedn_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, } -static uint -my_ismbchar_utf16(CHARSET_INFO *cs, const char *b, const char *e) -{ - my_wc_t wc; - int res= cs->cset->mb_wc(cs, &wc, (const uchar *) b, (const uchar *) e); - return (uint) (res > 0 ? res : 0); -} - - static int my_charlen_utf16(CHARSET_INFO *cs, const uchar *str, const uchar *end) { @@ -1431,15 +1460,6 @@ my_charlen_utf16(CHARSET_INFO *cs, const uchar *str, const uchar *end) /* Defines my_well_formed_char_length_utf16 */ -static uint -my_mbcharlen_utf16(CHARSET_INFO *cs __attribute__((unused)), - uint c __attribute__((unused))) -{ - DBUG_ASSERT(0); - return MY_UTF16_HIGH_HEAD(c) ? 4 : 2; -} - - static size_t my_numchars_utf16(CHARSET_INFO *cs, const char *b, const char *e) @@ -1447,7 +1467,7 @@ my_numchars_utf16(CHARSET_INFO *cs, size_t nchars= 0; for ( ; ; nchars++) { - size_t charlen= my_ismbchar_utf16(cs, b, e); + size_t charlen= my_ismbchar(cs, b, e); if (!charlen) break; b+= charlen; @@ -1472,27 +1492,6 @@ my_charpos_utf16(CHARSET_INFO *cs, } -static size_t -my_well_formed_len_utf16(CHARSET_INFO *cs, - const char *b, const char *e, - size_t nchars, int *error) -{ - const char *b0= b; - uint charlen; - *error= 0; - - for ( ; nchars; b+= charlen, nchars--) - { - if (!(charlen= my_ismbchar(cs, b, e))) - { - *error= b < e ? 1 : 0; - break; - } - } - return (size_t) (b - b0); -} - - static int my_wildcmp_utf16_ci(CHARSET_INFO *cs, const char *str,const char *str_end, @@ -1517,10 +1516,11 @@ my_wildcmp_utf16_bin(CHARSET_INFO *cs, static void -my_hash_sort_utf16_bin(CHARSET_INFO *cs, - const uchar *pos, size_t len, ulong *nr1, ulong *nr2) +my_hash_sort_utf16_nopad_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *pos, size_t len, + ulong *nr1, ulong *nr2) { - const uchar *end= pos + cs->cset->lengthsp(cs, (const char *) pos, len); + const uchar *end= pos + len; register ulong m1= *nr1, m2= *nr2; for ( ; pos < end ; pos++) @@ -1532,6 +1532,15 @@ my_hash_sort_utf16_bin(CHARSET_INFO *cs, } +static void +my_hash_sort_utf16_bin(CHARSET_INFO *cs, + const uchar *pos, size_t len, ulong *nr1, ulong *nr2) +{ + size_t lengthsp= cs->cset->lengthsp(cs, (const char *) pos, len); + my_hash_sort_utf16_nopad_bin(cs, pos, lengthsp, nr1, nr2); +} + + static MY_COLLATION_HANDLER my_collation_utf16_general_ci_handler = { NULL, /* init */ @@ -1564,14 +1573,43 @@ static MY_COLLATION_HANDLER my_collation_utf16_bin_handler = }; +static MY_COLLATION_HANDLER my_collation_utf16_general_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_utf16_general_ci, + my_strnncollsp_utf16_general_nopad_ci, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_generic, + my_wildcmp_utf16_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf16_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_utf16_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_utf16_bin, + my_strnncollsp_utf16_nopad_bin, + my_strnxfrm_unicode_full_nopad_bin, + my_strnxfrmlen_unicode_full_bin, + my_like_range_generic, + my_wildcmp_utf16_bin, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf16_nopad_bin, + my_propagate_simple +}; + + MY_CHARSET_HANDLER my_charset_utf16_handler= { NULL, /* init */ - my_ismbchar_utf16, /* ismbchar */ - my_mbcharlen_utf16, /* mbcharlen */ my_numchars_utf16, my_charpos_utf16, - my_well_formed_len_utf16, my_lengthsp_mb2, my_numcells_mb, my_utf16_uni, /* mb_wc */ @@ -1666,6 +1704,73 @@ struct charset_info_st my_charset_utf16_bin= }; +struct charset_info_st my_charset_utf16_general_nopad_ci= +{ + MY_NOPAD_ID(54),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD, + "utf16", /* cs name */ + "utf16_general_nopad_ci", /* name */ + "UTF-16 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_general_nopad_ci_handler +}; + + +struct charset_info_st my_charset_utf16_nopad_bin= +{ + MY_NOPAD_ID(55),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII| + MY_CS_NOPAD, + "utf16", /* cs name */ + "utf16_nopad_bin", /* name */ + "UTF-16 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_nopad_bin_handler +}; + + #define IS_MB2_CHAR(b0,b1) (!MY_UTF16_SURROGATE_HEAD(b1)) #define IS_MB4_CHAR(b0,b1,b2,b3) (MY_UTF16_HIGH_HEAD(b1) && MY_UTF16_LOW_HEAD(b3)) @@ -1681,6 +1786,20 @@ struct charset_info_st my_charset_utf16_bin= #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b1, b0, b3, b2)) #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf16le_general_nopad_ci +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b1,b0) +#define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER +#include "strcoll.ic" + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf16le_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB2(b0,b1) ((int) MY_UTF16_WC2(b1, b0)) +#define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b1, b0, b3, b2)) +#include "strcoll.ic" + #undef IS_MB2_CHAR #undef IS_MB4_CHAR @@ -1787,14 +1906,43 @@ static MY_COLLATION_HANDLER my_collation_utf16le_bin_handler = }; +static MY_COLLATION_HANDLER my_collation_utf16le_general_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_utf16le_general_ci, + my_strnncollsp_utf16le_general_nopad_ci, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_generic, + my_wildcmp_utf16_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf16_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_utf16le_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_utf16le_bin, + my_strnncollsp_utf16le_nopad_bin, + my_strnxfrm_unicode_full_nopad_bin, + my_strnxfrmlen_unicode_full_bin, + my_like_range_generic, + my_wildcmp_utf16_bin, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf16_nopad_bin, + my_propagate_simple +}; + + static MY_CHARSET_HANDLER my_charset_utf16le_handler= { NULL, /* init */ - my_ismbchar_utf16, - my_mbcharlen_utf16, my_numchars_utf16, my_charpos_utf16, - my_well_formed_len_utf16, my_lengthsp_utf16le, my_numcells_mb, my_utf16le_uni, /* mb_wc */ @@ -1889,6 +2037,73 @@ struct charset_info_st my_charset_utf16le_bin= }; +struct charset_info_st my_charset_utf16le_general_nopad_ci= +{ + MY_NOPAD_ID(56),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD, + "utf16le", /* cs name */ + "utf16le_general_nopad_ci",/* name */ + "UTF-16LE Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf16le_handler, + &my_collation_utf16le_general_nopad_ci_handler +}; + + +struct charset_info_st my_charset_utf16le_nopad_bin= +{ + MY_NOPAD_ID(62),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII| + MY_CS_NOPAD, + "utf16le", /* cs name */ + "utf16le_nopad_bin", /* name */ + "UTF-16LE Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf16le_handler, + &my_collation_utf16le_nopad_bin_handler +}; + + #endif /* HAVE_CHARSET_utf16 */ @@ -1926,6 +2141,18 @@ static inline int my_weight_utf32_general_ci(uchar b0, uchar b1, #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF32_WC4(b0, b1, b2, b3)) #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf32_general_nopad_ci +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB4(b0,b1,b2,b3) my_weight_utf32_general_ci(b0, b1, b2, b3) +#include "strcoll.ic" + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf32_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF32_WC4(b0, b1, b2, b3)) +#include "strcoll.ic" + #undef IS_MB2_CHAR #undef IS_MB4_CHAR @@ -1994,6 +2221,18 @@ my_tosort_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) static size_t +my_lengthsp_utf32(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr, size_t length) +{ + const char *end= ptr + length; + DBUG_ASSERT((length % 4) == 0); + while (end > ptr + 3 && end[-1] == ' ' && !end[-2] && !end[-3] && !end[-4]) + end-= 4; + return (size_t) (end - ptr); +} + + +static size_t my_caseup_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, char *dst, size_t dstlen) { @@ -2018,8 +2257,8 @@ my_caseup_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, static void -my_hash_sort_utf32(CHARSET_INFO *cs, const uchar *s, size_t slen, - ulong *nr1, ulong *nr2) +my_hash_sort_utf32_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) { my_wc_t wc; int res; @@ -2027,10 +2266,6 @@ my_hash_sort_utf32(CHARSET_INFO *cs, const uchar *s, size_t slen, MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; - /* Skip trailing spaces */ - while (e > s + 3 && e[-1] == ' ' && !e[-2] && !e[-3] && !e[-4]) - e-= 4; - while ((res= my_utf32_uni(cs, &wc, (uchar*) s, (uchar*) e)) > 0) { my_tosort_utf32(uni_plane, &wc); @@ -2045,6 +2280,15 @@ my_hash_sort_utf32(CHARSET_INFO *cs, const uchar *s, size_t slen, } +static void +my_hash_sort_utf32(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) +{ + size_t lengthsp= my_lengthsp_utf32(cs, (const char *) s, slen); + my_hash_sort_utf32_nopad(cs, s, lengthsp, nr1, nr2); +} + + static size_t my_casedn_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, char *dst, size_t dstlen) @@ -2068,15 +2312,6 @@ my_casedn_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, } -static uint -my_ismbchar_utf32(CHARSET_INFO *cs __attribute__((unused)), - const char *b, - const char *e) -{ - return b + 4 > e || !IS_UTF32_MBHEAD4(b[0], b[1]) ? 0 : 4; -} - - static int my_charlen_utf32(CHARSET_INFO *cs __attribute__((unused)), const uchar *b, const uchar *e) @@ -2096,15 +2331,7 @@ my_charlen_utf32(CHARSET_INFO *cs __attribute__((unused)), /* Defines my_well_formed_char_length_utf32 */ -static uint -my_mbcharlen_utf32(CHARSET_INFO *cs __attribute__((unused)) , - uint c __attribute__((unused))) -{ - return 4; -} - - -static int +static size_t my_vsnprintf_utf32(char *dst, size_t n, const char* fmt, va_list ap) { char *start= dst, *end= dst + n; @@ -2390,34 +2617,6 @@ my_charpos_utf32(CHARSET_INFO *cs __attribute__((unused)), } -static size_t -my_well_formed_len_utf32(CHARSET_INFO *cs __attribute__((unused)), - const char *b, const char *e, - size_t nchars, int *error) -{ - /* Ensure string length is divisible by 4 */ - const char *b0= b; - size_t length= e - b; - DBUG_ASSERT((length % 4) == 0); - *error= 0; - nchars*= 4; - if (length > nchars) - { - length= nchars; - e= b + nchars; - } - for (; b < e; b+= 4) - { - if (!IS_UTF32_MBHEAD4(b[0], b[1])) - { - *error= 1; - return b - b0; - } - } - return length; -} - - static void my_fill_utf32(CHARSET_INFO *cs, char *s, size_t slen, int fill) @@ -2444,18 +2643,6 @@ void my_fill_utf32(CHARSET_INFO *cs, } -static size_t -my_lengthsp_utf32(CHARSET_INFO *cs __attribute__((unused)), - const char *ptr, size_t length) -{ - const char *end= ptr + length; - DBUG_ASSERT((length % 4) == 0); - while (end > ptr + 3 && end[-1] == ' ' && !end[-2] && !end[-3] && !end[-4]) - end-= 4; - return (size_t) (end - ptr); -} - - static int my_wildcmp_utf32_ci(CHARSET_INFO *cs, const char *str, const char *str_end, @@ -2497,6 +2684,9 @@ my_scan_utf32(CHARSET_INFO *cs, str+= res; } return (size_t) (str - str0); + case MY_SEQ_NONSPACES: + DBUG_ASSERT(0); /* Not implemented */ + /* pass through */ default: return 0; } @@ -2535,14 +2725,43 @@ static MY_COLLATION_HANDLER my_collation_utf32_bin_handler = }; +static MY_COLLATION_HANDLER my_collation_utf32_general_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_utf32_general_ci, + my_strnncollsp_utf32_general_nopad_ci, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_generic, + my_wildcmp_utf32_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf32_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_utf32_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_utf32_bin, + my_strnncollsp_utf32_nopad_bin, + my_strnxfrm_unicode_full_nopad_bin, + my_strnxfrmlen_unicode_full_bin, + my_like_range_generic, + my_wildcmp_utf32_bin, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf32_nopad, + my_propagate_simple +}; + + MY_CHARSET_HANDLER my_charset_utf32_handler= { NULL, /* init */ - my_ismbchar_utf32, - my_mbcharlen_utf32, my_numchars_utf32, my_charpos_utf32, - my_well_formed_len_utf32, my_lengthsp_utf32, my_numcells_mb, my_utf32_uni, @@ -2637,6 +2856,73 @@ struct charset_info_st my_charset_utf32_bin= }; +struct charset_info_st my_charset_utf32_general_nopad_ci= +{ + MY_NOPAD_ID(60),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD, + "utf32", /* cs name */ + "utf32_general_nopad_ci", /* name */ + "UTF-32 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_general_nopad_ci_handler +}; + + +struct charset_info_st my_charset_utf32_nopad_bin= +{ + MY_NOPAD_ID(61),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII| + MY_CS_NOPAD, + "utf32", /* cs name */ + "utf32_nopad_bin", /* name */ + "UTF-32 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_nopad_bin_handler +}; + + #endif /* HAVE_CHARSET_utf32 */ @@ -2726,6 +3012,20 @@ static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1) #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_general_nopad_ci +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_ci(b0,b1) +#include "strcoll.ic" + + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB2(b0,b1) UCS2_CODE(b0,b1) +#include "strcoll.ic" + + static int my_charlen_ucs2(CHARSET_INFO *cs __attribute__((unused)), const uchar *s, const uchar *e) @@ -2808,8 +3108,9 @@ static size_t my_caseup_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen, } -static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen, - ulong *nr1, ulong *nr2) +static void +my_hash_sort_ucs2_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) { my_wc_t wc; int res; @@ -2817,9 +3118,6 @@ static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen, MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; - while (e > s+1 && e[-1] == ' ' && e[-2] == '\0') - e-= 2; - while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e)) >0) { my_tosort_ucs2(uni_plane, &wc); @@ -2831,6 +3129,13 @@ static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen, } +static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) +{ + size_t lengthsp= my_lengthsp_mb2(cs, (const char *) s, slen); + my_hash_sort_ucs2_nopad(cs, s, lengthsp, nr1, nr2); +} + static size_t my_casedn_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen, char *dst, size_t dstlen) { @@ -2878,21 +3183,6 @@ my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)), } -static uint my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)), - const char *b, - const char *e) -{ - return b + 2 > e ? 0 : 2; -} - - -static uint my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) , - uint c __attribute__((unused))) -{ - return 2; -} - - static size_t my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)), const char *b, const char *e) @@ -2912,19 +3202,6 @@ size_t my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)), } -static -size_t my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)), - const char *b, const char *e, - size_t nchars, int *error) -{ - /* Ensure string length is dividable with 2 */ - size_t nbytes= ((size_t) (e-b)) & ~(size_t) 1; - *error= 0; - nchars*= 2; - return MY_MIN(nbytes, nchars); -} - - static size_t my_well_formed_char_length_ucs2(CHARSET_INFO *cs __attribute__((unused)), const char *b, const char *e, @@ -2973,17 +3250,14 @@ int my_wildcmp_ucs2_bin(CHARSET_INFO *cs, } -static -void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), - const uchar *key, size_t len,ulong *nr1, ulong *nr2) +static void +my_hash_sort_ucs2_nopad_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len, + ulong *nr1, ulong *nr2) { - const uchar *end = key + len; + const uchar *end= key + len; register ulong m1= *nr1, m2= *nr2; - - while (end > key+1 && end[-1] == ' ' && end[-2] == '\0') - end-= 2; - - for (; key < (uchar*) end ; key++) + for ( ; key < end ; key++) { MY_HASH_ADD(m1, m2, (uint)*key); } @@ -2992,6 +3266,15 @@ void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), } +static void +my_hash_sort_ucs2_bin(CHARSET_INFO *cs, + const uchar *key, size_t len, ulong *nr1, ulong *nr2) +{ + size_t lengthsp= my_lengthsp_mb2(cs, (const char *) key, len); + my_hash_sort_ucs2_nopad_bin(cs, key, lengthsp, nr1, nr2); +} + + static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = { NULL, /* init */ @@ -3024,14 +3307,43 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler = }; +static MY_COLLATION_HANDLER my_collation_ucs2_general_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_ucs2_general_ci, + my_strnncollsp_ucs2_general_nopad_ci, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_generic, + my_wildcmp_ucs2_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_ucs2_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_ucs2_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_ucs2_bin, + my_strnncollsp_ucs2_nopad_bin, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_generic, + my_wildcmp_ucs2_bin, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_ucs2_nopad_bin, + my_propagate_simple +}; + + MY_CHARSET_HANDLER my_charset_ucs2_handler= { NULL, /* init */ - my_ismbchar_ucs2, /* ismbchar */ - my_mbcharlen_ucs2, /* mbcharlen */ my_numchars_ucs2, my_charpos_ucs2, - my_well_formed_len_ucs2, my_lengthsp_mb2, my_numcells_mb, my_ucs2_uni, /* mb_wc */ @@ -3159,4 +3471,69 @@ struct charset_info_st my_charset_ucs2_bin= }; +struct charset_info_st my_charset_ucs2_general_nopad_ci= +{ + MY_NOPAD_ID(35),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD, + "ucs2", /* cs name */ + "ucs2_general_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ucs2, /* ctype */ + to_lower_ucs2, /* to_lower */ + to_upper_ucs2, /* to_upper */ + to_upper_ucs2, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_general_nopad_ci_handler +}; + + +struct charset_info_st my_charset_ucs2_nopad_bin= +{ + MY_NOPAD_ID(90),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD, + "ucs2", /* cs name */ + "ucs2_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ucs2, /* ctype */ + to_lower_ucs2, /* to_lower */ + to_upper_ucs2, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_nopad_bin_handler +}; + #endif /* HAVE_CHARSET_ucs2 */ diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 22fbf425602..949f3aadc36 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -198,6 +198,7 @@ static const uchar sort_order_ujis[]= #define IS_MB2_KATA(x,y) (isujis_ss2(x) && iskata(y)) #define IS_MB2_CHAR(x, y) (IS_MB2_KATA(x,y) || IS_MB2_JIS(x,y)) #define IS_MB3_CHAR(x, y, z) (isujis_ss3(x) && IS_MB2_JIS(y,z)) +#define IS_MB_PREFIX2(x,y) (isujis_ss3(x) && isujis(y)) #define DEFINE_ASIAN_ROUTINES #include "ctype-mb.ic" @@ -219,20 +220,24 @@ static const uchar sort_order_ujis[]= #include "strcoll.ic" -static uint ismbchar_ujis(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return ((*(uchar*)(p)<0x80)? 0:\ - isujis(*(p)) && (e)-(p)>1 && isujis(*((p)+1))? 2:\ - isujis_ss2(*(p)) && (e)-(p)>1 && iskata(*((p)+1))? 2:\ - isujis_ss3(*(p)) && (e)-(p)>2 && isujis(*((p)+1)) && isujis(*((p)+2))? 3:\ - 0); -} +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _ujis_japanese_nopad_ci +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(x) ((int) sort_order_ujis[(uchar) (x)]) +#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ + (((uint) (uchar) (y)) << 8)) +#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#include "strcoll.ic" -static uint mbcharlen_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c) -{ - return (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 1); -} + +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _ujis_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(x) ((int) (uchar) (x)) +#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ + (((uint) (uchar) (y)) << 8)) +#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#include "strcoll.ic" static @@ -67261,14 +67266,43 @@ static MY_COLLATION_HANDLER my_collation_ujis_bin_handler = }; +static MY_COLLATION_HANDLER my_collation_ujis_japanese_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_ujis_japanese_ci, + my_strnncollsp_ujis_japanese_nopad_ci, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb, + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple_nopad, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_ujis_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_ujis_bin, + my_strnncollsp_ujis_nopad_bin, + my_strnxfrm_mb_nopad, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + static MY_CHARSET_HANDLER my_charset_handler= { NULL, /* init */ - ismbchar_ujis, - mbcharlen_ujis, my_numchars_mb, my_charpos_mb, - my_well_formed_len_ujis, my_lengthsp_8bit, my_numcells_eucjp, my_mb_wc_euc_jp, /* mb_wc */ @@ -67364,4 +67398,70 @@ struct charset_info_st my_charset_ujis_bin= }; +struct charset_info_st my_charset_ujis_japanese_nopad_ci= +{ + MY_NOPAD_ID(12),0,0,/* number */ + MY_CS_COMPILED|MY_CS_NOPAD, /* state */ + "ujis", /* cs name */ + "ujis_japanese_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ujis, + to_lower_ujis, + to_upper_ujis, + sort_order_ujis, + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_ujis, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 2, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFEFE, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ujis_japanese_nopad_ci_handler +}; + + +struct charset_info_st my_charset_ujis_nopad_bin= +{ + MY_NOPAD_ID(91),0,0,/* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */ + "ujis", /* cs name */ + "ujis_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ujis, + to_lower_ujis, + to_upper_ujis, + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_caseinfo_ujis, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 2, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFEFE, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ujis_nopad_bin_handler +}; + + #endif /* HAVE_CHARSET_ujis */ diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 25fb081bbb2..8f3b1224404 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2019, MariaDB + Copyright (c) 2009, 2017, MariaDB This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -111,7 +111,9 @@ #define MY_UTF8MB3_BIN MY_UTF8MB3 "_bin" #define MY_UTF8MB4_GENERAL_CI MY_UTF8MB4 "_general_ci" #define MY_UTF8MB4_GENERAL_CS MY_UTF8MB4 "_general_cs" +#define MY_UTF8MB4_GENERAL_NOPAD_CI MY_UTF8MB4 "_general_nopad_ci" #define MY_UTF8MB4_BIN MY_UTF8MB4 "_bin" +#define MY_UTF8MB4_NOPAD_BIN MY_UTF8MB4 "_nopad_bin" @@ -4688,30 +4690,19 @@ my_strxfrm_pad_unicode(uchar *str, uchar *strend) } -/* - Store sorting weights using 2 bytes per character. - - This function is shared between - - utf8mb3_general_ci, utf8_bin, ucs2_general_ci, ucs2_bin - which support BMP only (U+0000..U+FFFF). - - utf8mb4_general_ci, utf16_general_ci, utf32_general_ci, - which map all supplementary characters to weight 0xFFFD. -*/ -size_t -my_strnxfrm_unicode(CHARSET_INFO *cs, - uchar *dst, size_t dstlen, uint nweights, - const uchar *src, size_t srclen, uint flags) +size_t my_strnxfrm_unicode_internal(CHARSET_INFO *cs, + uchar *dst, uchar *de, uint *nweights, + const uchar *src, const uchar *se) { my_wc_t UNINIT_VAR(wc); int res; uchar *dst0= dst; - uchar *de= dst + dstlen; - const uchar *se= src + srclen; MY_UNICASE_INFO *uni_plane= (cs->state & MY_CS_BINSORT) ? NULL : cs->caseinfo; - DBUG_ASSERT(!srclen || src); - for (; dst < de && nweights; nweights--) + DBUG_ASSERT(src || !se); + + for (; dst < de && *nweights; (*nweights)--) { if ((res= cs->cset->mb_wc(cs, &wc, src, se)) <= 0) break; @@ -4724,6 +4715,29 @@ my_strnxfrm_unicode(CHARSET_INFO *cs, if (dst < de) *dst++= (uchar) (wc & 0xFF); } + return dst - dst0; +} + + +/* + Store sorting weights using 2 bytes per character. + + This function is shared between + - utf8mb3_general_ci, utf8_bin, ucs2_general_ci, ucs2_bin + which support BMP only (U+0000..U+FFFF). + - utf8mb4_general_ci, utf16_general_ci, utf32_general_ci, + which map all supplementary characters to weight 0xFFFD. +*/ +size_t +my_strnxfrm_unicode(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *dst0= dst; + uchar *de= dst + dstlen; + dst+= my_strnxfrm_unicode_internal(cs, dst, de, &nweights, + src, src + srclen); + DBUG_ASSERT(dst <= de); /* Safety */ if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) dst+= my_strxfrm_pad_nweights_unicode(dst, de, nweights); @@ -4736,6 +4750,35 @@ my_strnxfrm_unicode(CHARSET_INFO *cs, } +size_t +my_strnxfrm_unicode_nopad(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *dst0= dst; + uchar *de= dst + dstlen; + dst+= my_strnxfrm_unicode_internal(cs, dst, de, &nweights, + src, src + srclen); + DBUG_ASSERT(dst <= de); /* Safety */ + + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + size_t len= de - dst; + set_if_smaller(len, nweights * 2); + memset(dst, 0x00, len); + dst+= len; + } + + my_strxfrm_desc_and_reverse(dst0, dst, flags, 0); + + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) + { + memset(dst, 0x00, de - dst); + dst= de; + } + return dst - dst0; +} + /* For BMP-only collations that use 2 bytes per weight. */ @@ -4746,24 +4789,18 @@ my_strnxfrmlen_unicode(CHARSET_INFO *cs, size_t len) return ((len + cs->mbmaxlen - 1) / cs->mbmaxlen) * 2; } -/* - Store sorting weights using 3 bytes per character. - This function is shared between utf8mb4_bin, utf16_bin, utf32_bin. -*/ size_t -my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, - uchar *dst, size_t dstlen, uint nweights, - const uchar *src, size_t srclen, uint flags) +my_strnxfrm_unicode_full_bin_internal(CHARSET_INFO *cs, + uchar *dst, uchar *de, uint *nweights, + const uchar *src, const uchar *se) { my_wc_t UNINIT_VAR(wc); uchar *dst0= dst; - uchar *de= dst + dstlen; - const uchar *se = src + srclen; - DBUG_ASSERT(!srclen || src); + DBUG_ASSERT(src || !se); DBUG_ASSERT(cs->state & MY_CS_BINSORT); - for ( ; dst < de && nweights; nweights--) + for (; dst < de && *nweights; (*nweights)--) { int res; if ((res= cs->cset->mb_wc(cs, &wc, src, se)) <= 0) @@ -4777,6 +4814,25 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, *dst++= (uchar) (wc & 0xFF); } } + return dst - dst0; +} + + +/* + Store sorting weights using 3 bytes per character. + This function is shared between utf8mb4_bin, utf16_bin, utf32_bin. +*/ +size_t +my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *dst0= dst; + uchar *de= dst + dstlen; + + dst+= my_strnxfrm_unicode_full_bin_internal(cs, dst, de, &nweights, + src, src + srclen); + DBUG_ASSERT(dst <= de); /* Safety */ if (flags & MY_STRXFRM_PAD_WITH_SPACE) { @@ -4791,7 +4847,7 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, } } } - + my_strxfrm_desc_and_reverse(dst0, dst, flags, 0); if (flags & MY_STRXFRM_PAD_TO_MAXLEN) @@ -4812,6 +4868,37 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, size_t +my_strnxfrm_unicode_full_nopad_bin(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *dst0= dst; + uchar *de= dst + dstlen; + + dst+= my_strnxfrm_unicode_full_bin_internal(cs, dst, de, &nweights, + src, src + srclen); + DBUG_ASSERT(dst <= de); /* Safety */ + + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + size_t len= de - dst; + set_if_smaller(len, nweights * 3); + memset(dst, 0x00, len); + dst+= len; + } + + my_strxfrm_desc_and_reverse(dst0, dst, flags, 0); + + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) + { + memset(dst, 0x00, de - dst); + dst= de; + } + return dst - dst0; +} + + +size_t my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *cs, size_t len) { return ((len + 3) / cs->mbmaxlen) * 3; @@ -5072,33 +5159,38 @@ static size_t my_caseup_utf8(CHARSET_INFO *cs, const char *src, size_t srclen, } -static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, size_t slen, - ulong *nr1, ulong *nr2) +static void my_hash_sort_utf8mb3_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) { my_wc_t wc; int res; - const uchar *e=s+slen; + const uchar *e= s+slen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; - /* - Remove end space. We have to do this to be able to compare - 'A ' and 'A' as identical - */ - while (e > s && e[-1] == ' ') - e--; - while ((s < e) && (res=my_utf8_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 ) { my_tosort_unicode(uni_plane, &wc, cs->state); MY_HASH_ADD_16(m1, m2, wc); - s+=res; + s+= res; } *nr1= m1; *nr2= m2; } +static void my_hash_sort_utf8mb3(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) +{ + /* + Remove end space. We have to do this to be able to compare + 'A ' and 'A' as identical + */ + const uchar *e= skip_trailing_space(s, slen); + my_hash_sort_utf8mb3_nopad(cs, s, e - s, nr1, nr2); +} + + static size_t my_caseup_str_utf8(CHARSET_INFO *cs, char *src) { my_wc_t wc; @@ -5306,27 +5398,6 @@ int my_charlen_utf8(CHARSET_INFO *cs __attribute__((unused)), return MY_CS_ILSEQ; } -static size_t -my_well_formed_len_utf8(CHARSET_INFO *cs, const char *b, const char *e, - size_t pos, int *error) -{ - const char *b_start= b; - *error= 0; - while (pos) - { - int mb_len; - - if ((mb_len= my_charlen_utf8(cs, (uchar*) b, (uchar*) e)) <= 0) - { - *error= b < e ? 1 : 0; - break; - } - b+= mb_len; - pos--; - } - return (size_t) (b - b_start); -} - #define MY_FUNCTION_NAME(x) my_ ## x ## _utf8 #define CHARLEN(cs,str,end) my_charlen_utf8(cs,str,end) @@ -5368,6 +5439,15 @@ static inline int my_weight_mb3_utf8_general_ci(uchar b0, uchar b1, uchar b2) #include "strcoll.ic" +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf8_general_nopad_ci +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(x) my_weight_mb1_utf8_general_ci(x) +#define WEIGHT_MB2(x,y) my_weight_mb2_utf8_general_ci(x,y) +#define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8_general_ci(x,y,z) +#include "strcoll.ic" + + static inline int my_weight_mb1_utf8_general_mysql500_ci(uchar b) { return (int) plane00_mysql500[b & 0xFF].sort; @@ -5407,26 +5487,13 @@ my_weight_mb3_utf8_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #include "strcoll.ic" -static uint my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e) -{ - int res= my_charlen_utf8(cs, (const uchar*) b, (const uchar*) e); - return (res>1) ? res : 0; -} - -static uint my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)), - uint c) -{ - if (c < 0x80) - return 1; - else if (c < 0xc2) - return 0; /* Illegal mb head */ - else if (c < 0xe0) - return 2; - else if (c < 0xf0) - return 3; - return 0; /* Illegal mb head */; -} - +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf8_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(x) ((int) (uchar) (x)) +#define WEIGHT_MB2(x,y) ((int) UTF8MB2_CODE(x,y)) +#define WEIGHT_MB3(x,y,z) ((int) UTF8MB3_CODE(x,y,z)) +#include "strcoll.ic" /* TODO-10.2: join this with pad_max_char() in ctype-mb.c @@ -5471,7 +5538,7 @@ static MY_COLLATION_HANDLER my_collation_utf8_general_ci_handler = my_wildcmp_utf8, my_strcasecmp_utf8, my_instr_mb, - my_hash_sort_utf8, + my_hash_sort_utf8mb3, my_propagate_complex }; @@ -5487,7 +5554,7 @@ static MY_COLLATION_HANDLER my_collation_utf8_general_mysql500_ci_handler = my_wildcmp_utf8, my_strcasecmp_utf8, my_instr_mb, - my_hash_sort_utf8, + my_hash_sort_utf8mb3, my_propagate_complex }; @@ -5507,14 +5574,44 @@ static MY_COLLATION_HANDLER my_collation_utf8_bin_handler = my_propagate_simple }; + +static MY_COLLATION_HANDLER my_collation_utf8_general_nopad_ci_handler = +{ + NULL, /* init */ + my_strnncoll_utf8_general_ci, + my_strnncollsp_utf8_general_nopad_ci, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_mb, + my_wildcmp_utf8, + my_strcasecmp_utf8, + my_instr_mb, + my_hash_sort_utf8mb3_nopad, + my_propagate_complex +}; + + +static MY_COLLATION_HANDLER my_collation_utf8_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_utf8_bin, + my_strnncollsp_utf8_nopad_bin, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + MY_CHARSET_HANDLER my_charset_utf8_handler= { NULL, /* init */ - my_ismbchar_utf8, - my_mbcharlen_utf8, my_numchars_mb, my_charpos_mb, - my_well_formed_len_utf8, my_lengthsp_8bit, my_numcells_mb, my_utf8_uni, @@ -5642,6 +5739,73 @@ struct charset_info_st my_charset_utf8_bin= &my_collation_utf8_bin_handler }; + +struct charset_info_st my_charset_utf8_general_nopad_ci= +{ + MY_NOPAD_ID(33),0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NOPAD, /* state */ + "utf8", /* cs name */ + "utf8_general_nopad_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_utf8, /* ctype */ + to_lower_utf8, /* to_lower */ + to_upper_utf8, /* to_upper */ + to_upper_utf8, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8_handler, + &my_collation_utf8_general_nopad_ci_handler +}; + + +struct charset_info_st my_charset_utf8_nopad_bin= +{ + MY_NOPAD_ID(83),0,0,/* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NOPAD, + "utf8", /* cs name */ + "utf8_nopad_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_utf8, /* ctype */ + to_lower_utf8, /* to_lower */ + to_upper_utf8, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8_handler, + &my_collation_utf8_nopad_bin_handler +}; + + #ifdef HAVE_UTF8_GENERAL_CS /* @@ -5698,8 +5862,7 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs, static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference) + const uchar *t, size_t tlen) { int s_res, t_res, res; my_wc_t s_wc, t_wc; @@ -5708,10 +5871,6 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs, int save_diff= 0; MY_UNICASE_INFO *uni_plane= cs->caseinfo; -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif - while ( s < se && t < te ) { s_res=my_utf8_uni(cs,&s_wc, s, se); @@ -5742,37 +5901,22 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs, slen= se-s; tlen= te-t; - res= 0; - - if (slen != tlen) - { - int swap= 1; - if (diff_if_only_endspace_difference) - res= 1; /* Assume 'a' is bigger */ - if (slen < tlen) - { - slen= tlen; - s= t; - se= te; - swap= -1; - res= -res; - } - /* - This following loop uses the fact that in UTF-8 - all multibyte characters are greater than space, - and all multibyte head characters are greater than - space. It means if we meet a character greater - than space, it always means that the longer string - is greater. So we can reuse the same loop from the - 8bit version, without having to process full multibute - sequences. - */ - for ( ; s < se; s++) - { - if (*s != (uchar) ' ') - return (*s < (uchar) ' ') ? -swap : swap; - } - } + + /* + The following code uses the fact that in UTF-8 + all multibyte characters are greater than space, + and all multibyte head characters are greater than + space. It means if we meet a character greater + than space, it always means that the longer string + is greater. So we can reuse the same loop from the + 8bit version, without having to process full multibute + sequences. + */ + if ((res= slen == tlen ? 0 : + slen < tlen ? + -my_strnncollsp_padspace_bin(t, tlen) : + my_strnncollsp_padspace_bin(s, slen))) + return res; return save_diff; } @@ -7057,15 +7201,6 @@ my_charlen_filename(CHARSET_INFO *cs, const uchar *str, const uchar *end) } -static uint -my_ismbchar_filename(CHARSET_INFO *cs, const char *str, const char *end) -{ - my_wc_t wc; - int rc= my_mb_wc_filename(cs, &wc, (const uchar *) str, (const uchar *) end); - return rc > 1 ? rc : 0; -} - - #define MY_FUNCTION_NAME(x) my_ ## x ## _filename #define CHARLEN(cs,str,end) my_charlen_filename(cs,str,end) #define DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN @@ -7087,18 +7222,15 @@ static MY_COLLATION_HANDLER my_collation_filename_handler = my_wildcmp_utf8, my_strcasecmp_utf8, my_instr_mb, - my_hash_sort_utf8, + my_hash_sort_utf8mb3, my_propagate_complex }; static MY_CHARSET_HANDLER my_charset_filename_handler= { NULL, /* init */ - my_ismbchar_filename, - my_mbcharlen_utf8, my_numchars_mb, my_charpos_mb, - my_well_formed_len_mb, my_lengthsp_8bit, my_numcells_mb, my_mb_wc_filename, @@ -7161,57 +7293,6 @@ struct charset_info_st my_charset_filename= }; -#ifdef MY_TEST_UTF8 -#include <stdio.h> - -static void test_mb(CHARSET_INFO *cs, uchar *s) -{ - while(*s) - { - if (my_ismbhead_utf8(cs,*s)) - { - uint len=my_mbcharlen_utf8(cs,*s); - while(len--) - { - printf("%c",*s); - s++; - } - printf("\n"); - } - else - { - printf("%c\n",*s); - s++; - } - } -} - -int main() -{ - char str[1024]=" utf8 test проба ПЕРРпо-РУССКИ"; - CHARSET_INFO *cs; - - test_mb(cs,(uchar*)str); - - printf("orig :'%s'\n",str); - - my_caseup_utf8(cs,str,15); - printf("caseup :'%s'\n",str); - - my_caseup_str_utf8(cs,str); - printf("caseup_str:'%s'\n",str); - - my_casedn_utf8(cs,str,15); - printf("casedn :'%s'\n",str); - - my_casedn_str_utf8(cs,str); - printf("casedn_str:'%s'\n",str); - - return 0; -} - -#endif - #endif /* HAVE_CHARSET_UTF8 */ @@ -7507,7 +7588,7 @@ my_caseup_utf8mb4(CHARSET_INFO *cs, const char *src, size_t srclen, static void -my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, +my_hash_sort_utf8mb4_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, ulong *nr1, ulong *nr2) { my_wc_t wc; @@ -7516,13 +7597,6 @@ my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; - /* - Remove end space. We do this to be able to compare - 'A ' and 'A' as identical - */ - while (e > s && e[-1] == ' ') - e--; - while ((res= my_mb_wc_utf8mb4(cs, &wc, (uchar*) s, (uchar*) e)) > 0) { my_tosort_unicode(uni_plane, &wc, cs->state); @@ -7545,6 +7619,19 @@ my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, } +static void +my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) +{ + /* + Remove end space. We do this to be able to compare + 'A ' and 'A' as identical + */ + const uchar *e= skip_trailing_space(s, slen); + my_hash_sort_utf8mb4_nopad(cs, s, e - s, nr1, nr2); +} + + static size_t my_caseup_str_utf8mb4(CHARSET_INFO *cs, char *src) { @@ -7745,29 +7832,6 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), } -static -size_t my_well_formed_len_utf8mb4(CHARSET_INFO *cs, - const char *b, const char *e, - size_t pos, int *error) -{ - const char *b_start= b; - *error= 0; - while (pos) - { - int mb_len; - - if ((mb_len= my_charlen_utf8mb4(cs, (uchar*) b, (uchar*) e)) <= 0) - { - *error= b < e ? 1 : 0; - break; - } - b+= mb_len; - pos--; - } - return (size_t) (b - b_start); -} - - #define MY_FUNCTION_NAME(x) my_ ## x ## _utf8mb4 #define CHARLEN(cs,str,end) my_charlen_utf8mb4(cs,str,end) #define DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN @@ -7800,29 +7864,28 @@ size_t my_well_formed_len_utf8mb4(CHARSET_INFO *cs, #include "strcoll.ic" -static uint -my_ismbchar_utf8mb4(CHARSET_INFO *cs, const char *b, const char *e) -{ - int res= my_charlen_utf8mb4(cs, (const uchar*) b, (const uchar*) e); - return (res > 1) ? res : 0; -} +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf8mb4_general_nopad_ci +#define IS_MB4_CHAR(b0,b1,b2,b3) IS_UTF8MB4_STEP3(b0,b1,b2,b3) +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(b0) my_weight_mb1_utf8_general_ci(b0) +#define WEIGHT_MB2(b0,b1) my_weight_mb2_utf8_general_ci(b0,b1) +#define WEIGHT_MB3(b0,b1,b2) my_weight_mb3_utf8_general_ci(b0,b1,b2) +/* + All non-BMP characters have the same weight. +*/ +#define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER +#include "strcoll.ic" -static uint -my_mbcharlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), uint c) -{ - if (c < 0x80) - return 1; - if (c < 0xc2) - return 0; /* Illegal mb head */ - if (c < 0xe0) - return 2; - if (c < 0xf0) - return 3; - if (c < 0xf8) - return 4; - return 0; /* Illegal mb head */; -} +#define DEFINE_STRNNCOLLSP_NOPAD +#define MY_FUNCTION_NAME(x) my_ ## x ## _utf8mb4_nopad_bin +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB1(b0) ((int) (uchar) (b0)) +#define WEIGHT_MB2(b0,b1) ((int) UTF8MB2_CODE(b0,b1)) +#define WEIGHT_MB3(b0,b1,b2) ((int) UTF8MB3_CODE(b0,b1,b2)) +#define WEIGHT_MB4(b0,b1,b2,b3) ((int) UTF8MB4_CODE(b0,b1,b2,b3)) +#include "strcoll.ic" static MY_COLLATION_HANDLER my_collation_utf8mb4_general_ci_handler= @@ -7843,7 +7906,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb4_general_ci_handler= static MY_COLLATION_HANDLER my_collation_utf8mb4_bin_handler = { - NULL, /* init */ + NULL, /* init */ my_strnncoll_utf8mb4_bin, my_strnncollsp_utf8mb4_bin, my_strnxfrm_unicode_full_bin, @@ -7857,14 +7920,43 @@ static MY_COLLATION_HANDLER my_collation_utf8mb4_bin_handler = }; +static MY_COLLATION_HANDLER my_collation_utf8mb4_general_nopad_ci_handler= +{ + NULL, /* init */ + my_strnncoll_utf8mb4_general_ci, + my_strnncollsp_utf8mb4_general_nopad_ci, + my_strnxfrm_unicode_nopad, + my_strnxfrmlen_unicode, + my_like_range_mb, + my_wildcmp_utf8mb4, + my_strcasecmp_utf8mb4, + my_instr_mb, + my_hash_sort_utf8mb4_nopad, + my_propagate_complex +}; + + +static MY_COLLATION_HANDLER my_collation_utf8mb4_nopad_bin_handler = +{ + NULL, /* init */ + my_strnncoll_utf8mb4_bin, + my_strnncollsp_utf8mb4_nopad_bin, + my_strnxfrm_unicode_full_nopad_bin, + my_strnxfrmlen_unicode_full_bin, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_nopad_bin, + my_propagate_simple +}; + + MY_CHARSET_HANDLER my_charset_utf8mb4_handler= { NULL, /* init */ - my_ismbchar_utf8mb4, - my_mbcharlen_utf8mb4, my_numchars_mb, my_charpos_mb, - my_well_formed_len_utf8mb4, my_lengthsp_8bit, my_numcells_mb, my_mb_wc_utf8mb4, @@ -7960,4 +8052,72 @@ struct charset_info_st my_charset_utf8mb4_bin= &my_collation_utf8mb4_bin_handler }; + +struct charset_info_st my_charset_utf8mb4_general_nopad_ci= +{ + MY_NOPAD_ID(45),0,0,/* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT| + MY_CS_NOPAD, /* state */ + MY_UTF8MB4, /* cs name */ + MY_UTF8MB4_GENERAL_NOPAD_CI,/* name */ + "UTF-8 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_utf8mb4, /* ctype */ + to_lower_utf8mb4, /* to_lower */ + to_upper_utf8mb4, /* to_upper */ + to_upper_utf8mb4, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_utf8mb4_general_nopad_ci_handler +}; + + +struct charset_info_st my_charset_utf8mb4_nopad_bin= +{ + MY_NOPAD_ID(46),0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE| + MY_CS_UNICODE_SUPPLEMENT|MY_CS_NOPAD, /* state */ + MY_UTF8MB4, /* cs name */ + MY_UTF8MB4_NOPAD_BIN, /* name */ + "UTF-8 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_utf8mb4, /* ctype */ + to_lower_utf8mb4, /* to_lower */ + to_upper_utf8mb4, /* to_upper */ + NULL, /* sort_order */ + NULL, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_default,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_utf8mb4_nopad_bin_handler +}; + #endif /* HAVE_CHARSET_utf8mb4 */ diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 0a6352b19af..f33a83294d6 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -478,9 +478,7 @@ static int my_strnncoll_win1250ch(CHARSET_INFO *cs __attribute__((unused)), static int my_strnncollsp_win1250ch(CHARSET_INFO * cs, const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool diff_if_only_endspace_difference - __attribute__((unused))) + const uchar *t, size_t tlen) { for ( ; slen && s[slen-1] == ' ' ; slen--); for ( ; tlen && t[tlen-1] == ' ' ; tlen--); diff --git a/strings/ctype.c b/strings/ctype.c index d68010e0015..b1fc48aa470 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -88,6 +88,8 @@ struct my_cs_file_section_st #define _CS_CL_SUPPRESS_CONTRACTIONS 101 #define _CS_CL_OPTIMIZE 102 #define _CS_CL_SHIFT_AFTER_METHOD 103 +#define _CS_CL_RULES_IMPORT 104 +#define _CS_CL_RULES_IMPORT_SOURCE 105 /* Collation Settings */ @@ -188,6 +190,8 @@ static const struct my_cs_file_section_st sec[] = {_CS_CL_SUPPRESS_CONTRACTIONS, "charsets/charset/collation/suppress_contractions"}, {_CS_CL_OPTIMIZE, "charsets/charset/collation/optimize"}, {_CS_CL_SHIFT_AFTER_METHOD, "charsets/charset/collation/shift-after-method"}, + {_CS_CL_RULES_IMPORT, "charsets/charset/collation/rules/import"}, + {_CS_CL_RULES_IMPORT_SOURCE, "charsets/charset/collation/rules/import/source"}, /* Collation Settings */ {_CS_ST_SETTINGS, "charsets/charset/collation/settings"}, @@ -614,6 +618,8 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) i->cs.state|= MY_CS_BINSORT; else if (!strncmp("compiled",attr,len)) i->cs.state|= MY_CS_COMPILED; + else if (!strncmp("nopad",attr,len)) + i->cs.state|= MY_CS_NOPAD; break; case _CS_UPPERMAP: fill_uchar(i->to_upper,MY_CS_TO_UPPER_TABLE_SIZE,attr,len); @@ -641,6 +647,10 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) rc= tailoring_append(st, "[version %.*s]", len, attr); break; + case _CS_CL_RULES_IMPORT_SOURCE: + rc= tailoring_append(st, "[import %.*s]", len, attr); + break; + case _CS_CL_SUPPRESS_CONTRACTIONS: rc= tailoring_append(st, "[suppress contractions %.*s]", len, attr); break; @@ -657,6 +667,8 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) case _CS_ST_STRENGTH: /* 1, 2, 3, 4, 5, or primary, secondary, tertiary, quaternary, identical */ rc= tailoring_append(st, "[strength %.*s]", len, attr); + if (len && attr[0] >= '1' && attr[0] <= '9') + i->cs.levels_for_order= attr[0] - '0'; break; case _CS_ST_ALTERNATE: @@ -892,11 +904,11 @@ my_string_metadata_get(MY_STRING_METADATA *metadata, if (cs->mbmaxlen == 1 && !(cs->state & MY_CS_NONASCII)) { metadata->char_length= length; - metadata->repertoire= my_string_repertoire_8bit(cs, str, length); + metadata->repertoire= my_string_repertoire_8bit(cs, str, (ulong)length); } else { - my_string_metadata_get_mb(metadata, cs, str, length); + my_string_metadata_get_mb(metadata, cs, str, (ulong)length); } } @@ -974,48 +986,6 @@ my_charset_is_ascii_based(CHARSET_INFO *cs) /* - Detect if a character set is 8bit, - and it is pure ascii, i.e. doesn't have - characters outside U+0000..U+007F - This functions is shared between "conf_to_src" - and dynamic charsets loader in "mysqld". -*/ -my_bool -my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs) -{ - size_t code; - if (!cs->tab_to_uni) - return 0; - for (code= 0; code < 256; code++) - { - if (cs->tab_to_uni[code] > 0x7F) - return 0; - } - return 1; -} - - -/* - Shared function between conf_to_src and mysys. - Check if a 8bit character set is compatible with - ascii on the range 0x00..0x7F. -*/ -my_bool -my_charset_is_ascii_compatible(CHARSET_INFO *cs) -{ - uint i; - if (!cs->tab_to_uni) - return 1; - for (i= 0; i < 128; i++) - { - if (cs->tab_to_uni[i] != i) - return 0; - } - return 1; -} - - -/* Convert a string between two character sets. 'to' must be large enough to store (form_length * to_cs->mbmaxlen) bytes. @@ -1170,7 +1140,9 @@ my_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, size_t my_convert_fix(CHARSET_INFO *to_cs, char *to, size_t to_length, CHARSET_INFO *from_cs, const char *from, size_t from_length, - size_t nchars, MY_STRCONV_STATUS *status) + size_t nchars, + MY_STRCOPY_STATUS *copy_status, + MY_STRCONV_STATUS *conv_status) { int cnvres; my_wc_t wc; @@ -1183,8 +1155,8 @@ my_convert_fix(CHARSET_INFO *to_cs, char *to, size_t to_length, DBUG_ASSERT(to_cs != &my_charset_bin); DBUG_ASSERT(from_cs != &my_charset_bin); - status->m_native_copy_status.m_well_formed_error_pos= NULL; - status->m_cannot_convert_error_pos= NULL; + copy_status->m_well_formed_error_pos= NULL; + conv_status->m_cannot_convert_error_pos= NULL; for ( ; nchars; nchars--) { @@ -1193,8 +1165,8 @@ my_convert_fix(CHARSET_INFO *to_cs, char *to, size_t to_length, from+= cnvres; else if (cnvres == MY_CS_ILSEQ) { - if (!status->m_native_copy_status.m_well_formed_error_pos) - status->m_native_copy_status.m_well_formed_error_pos= from; + if (!copy_status->m_well_formed_error_pos) + copy_status->m_well_formed_error_pos= from; from++; wc= '?'; } @@ -1204,8 +1176,8 @@ my_convert_fix(CHARSET_INFO *to_cs, char *to, size_t to_length, A correct multibyte sequence detected But it doesn't have Unicode mapping. */ - if (!status->m_cannot_convert_error_pos) - status->m_cannot_convert_error_pos= from; + if (!conv_status->m_cannot_convert_error_pos) + conv_status->m_cannot_convert_error_pos= from; from+= (-cnvres); wc= '?'; } @@ -1214,8 +1186,8 @@ my_convert_fix(CHARSET_INFO *to_cs, char *to, size_t to_length, if ((uchar *) from >= from_end) break; // End of line // Incomplete byte sequence - if (!status->m_native_copy_status.m_well_formed_error_pos) - status->m_native_copy_status.m_well_formed_error_pos= from; + if (!copy_status->m_well_formed_error_pos) + copy_status->m_well_formed_error_pos= from; from++; wc= '?'; } @@ -1224,8 +1196,8 @@ outp: to+= cnvres; else if (cnvres == MY_CS_ILUNI && wc != '?') { - if (!status->m_cannot_convert_error_pos) - status->m_cannot_convert_error_pos= from_prev; + if (!conv_status->m_cannot_convert_error_pos) + conv_status->m_cannot_convert_error_pos= from_prev; wc= '?'; goto outp; } @@ -1235,6 +1207,6 @@ outp: break; } } - status->m_native_copy_status.m_source_end_pos= from; + copy_status->m_source_end_pos= from; return to - to_start; } diff --git a/strings/decimal.c b/strings/decimal.c index dd2e1236489..2dd7c960a3e 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -283,7 +283,7 @@ static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result) from number for processing */ -int decimal_actual_fraction(decimal_t *from) +int decimal_actual_fraction(const decimal_t *from) { int frac= from->frac, i; dec1 *buf0= from->buf + ROUND_UP(from->intg) + ROUND_UP(frac) - 1; @@ -457,7 +457,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result) dec1 *end= from->buf + ROUND_UP(from->intg) + ROUND_UP(from->frac); dec1 *buf_end= end - 1; - /* find non-zero digit from number begining */ + /* find non-zero digit from number beginning */ while (buf_beg < end && *buf_beg == 0) buf_beg++; @@ -468,7 +468,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result) return; } - /* find non-zero decimal digit from number begining */ + /* find non-zero decimal digit from number beginning */ if (buf_beg == from->buf && from->intg) { start= DIG_PER_DEC1 - (i= ((from->intg-1) % DIG_PER_DEC1 + 1)); @@ -1018,6 +1018,12 @@ static int ull2dec(ulonglong from, decimal_t *to) sanity(to); + if (!from) + { + decimal_make_zero(to); + return E_DEC_OK; + } + for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {} if (unlikely(intg1 > to->len)) { @@ -1025,7 +1031,7 @@ static int ull2dec(ulonglong from, decimal_t *to) error=E_DEC_OVERFLOW; } to->frac=0; - to->intg=intg1*DIG_PER_DEC1; + for(to->intg= (intg1-1)*DIG_PER_DEC1; from; to->intg++, from/=10) {} for (buf=to->buf+intg1; intg1; intg1--) { diff --git a/strings/dtoa.c b/strings/dtoa.c index d11c5e346c5..d893d8e4bce 100644 --- a/strings/dtoa.c +++ b/strings/dtoa.c @@ -91,7 +91,7 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error) int decpt, sign, len, i; char *res, *src, *end, *dst= to; char buf[DTOA_BUFF_SIZE]; - DBUG_ASSERT(precision >= 0 && precision < NOT_FIXED_DEC && to != NULL); + DBUG_ASSERT(precision >= 0 && precision < DECIMAL_NOT_SPECIFIED && to != NULL); res= dtoa(x, 5, precision, &decpt, &sign, &end, buf, sizeof(buf)); @@ -106,7 +106,7 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error) } src= res; - len= end - src; + len= (int)(end - src); if (sign) *dst++= '-'; @@ -238,7 +238,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, *error= FALSE; src= res; - len= end - res; + len= (int)(end - res); /* Number of digits in the exponent from the 'e' conversion. @@ -330,7 +330,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, dtoa_free(res, buf, sizeof(buf)); res= dtoa(x, 5, width - decpt, &decpt, &sign, &end, buf, sizeof(buf)); src= res; - len= end - res; + len= (int)(end - res); } if (len == 0) @@ -396,7 +396,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, dtoa_free(res, buf, sizeof(buf)); res= dtoa(x, 4, width, &decpt, &sign, &end, buf, sizeof(buf)); src= res; - len= end - res; + len= (int)(end - res); if (--decpt < 0) decpt= -decpt; } diff --git a/strings/json_lib.c b/strings/json_lib.c new file mode 100644 index 00000000000..3ce9b0c503f --- /dev/null +++ b/strings/json_lib.c @@ -0,0 +1,1850 @@ +#include <my_global.h> +#include <string.h> +#include <m_ctype.h> + + +#include "json_lib.h" + +/* + JSON escaping lets user specify UTF16 codes of characters. + So we're going to need the UTF16 charset capabilities. Let's import + them from the utf16 charset. +*/ +int my_utf16_uni(CHARSET_INFO *cs, + my_wc_t *pwc, const uchar *s, const uchar *e); +int my_uni_utf16(CHARSET_INFO *cs, my_wc_t wc, uchar *s, uchar *e); + + +void json_string_set_str(json_string_t *s, + const uchar *str, const uchar *end) +{ + s->c_str= str; + s->str_end= end; +} + + +void json_string_set_cs(json_string_t *s, CHARSET_INFO *i_cs) +{ + s->cs= i_cs; + s->error= 0; + s->wc= i_cs->cset->mb_wc; +} + + +static void json_string_setup(json_string_t *s, + CHARSET_INFO *i_cs, const uchar *str, + const uchar *end) +{ + json_string_set_cs(s, i_cs); + json_string_set_str(s, str, end); +} + + +enum json_char_classes { + C_EOS, /* end of string */ + C_LCURB, /* { */ + C_RCURB, /* } */ + C_LSQRB, /* [ */ + C_RSQRB, /* ] */ + C_COLON, /* : */ + C_COMMA, /* , */ + C_QUOTE, /* " */ + C_DIGIT, /* -0123456789 */ + C_LOW_F, /* 'f' (for "false") */ + C_LOW_N, /* 'n' (for "null") */ + C_LOW_T, /* 't' (for "true") */ + C_ETC, /* everything else */ + C_ERR, /* character disallowed in JSON */ + C_BAD, /* invalid character, charset handler cannot read it */ + NR_C_CLASSES, /* Counter for classes that handled with functions. */ + C_SPACE /* space. Doesn't need specific handlers, so after the counter.*/ +}; + + +/* + This array maps first 128 Unicode Code Points into classes. + The remaining Unicode characters should be mapped to C_ETC. +*/ + +static enum json_char_classes json_chr_map[128] = { + C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, + C_ERR, C_SPACE, C_SPACE, C_ERR, C_ERR, C_SPACE, C_ERR, C_ERR, + C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, + C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, C_ERR, + + C_SPACE, C_ETC, C_QUOTE, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, + C_ETC, C_ETC, C_ETC, C_ETC, C_COMMA, C_DIGIT, C_ETC, C_ETC, + C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, + C_DIGIT, C_DIGIT, C_COLON, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, + + C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, + C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, + C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, + C_ETC, C_ETC, C_ETC, C_LSQRB, C_ETC, C_RSQRB, C_ETC, C_ETC, + + C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_LOW_F, C_ETC, + C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_LOW_N, C_ETC, + C_ETC, C_ETC, C_ETC, C_ETC, C_LOW_T, C_ETC, C_ETC, C_ETC, + C_ETC, C_ETC, C_ETC, C_LCURB, C_ETC, C_RCURB, C_ETC, C_ETC +}; + + +/* + JSON parser actually has more states than the 'enum json_states' + declares. But the rest of the states aren't seen to the user so let's + specify them here to avoid confusion. +*/ + +enum json_all_states { + JST_DONE= NR_JSON_USER_STATES, /* ok to finish */ + JST_OBJ_CONT= NR_JSON_USER_STATES+1, /* object continues */ + JST_ARRAY_CONT= NR_JSON_USER_STATES+2, /* array continues */ + JST_READ_VALUE= NR_JSON_USER_STATES+3, /* value is being read */ + NR_JSON_STATES= NR_JSON_USER_STATES+4 +}; + + +typedef int (*json_state_handler)(json_engine_t *); + + +/* The string is broken. */ +static int unexpected_eos(json_engine_t *j) +{ + j->s.error= JE_EOS; + return 1; +} + + +/* This symbol here breaks the JSON syntax. */ +static int syntax_error(json_engine_t *j) +{ + j->s.error= JE_SYN; + return 1; +} + + +/* Value of object. */ +static int mark_object(json_engine_t *j) +{ + j->state= JST_OBJ_START; + if (++j->stack_p < JSON_DEPTH_LIMIT) + { + j->stack[j->stack_p]= JST_OBJ_CONT; + return 0; + } + j->s.error= JE_DEPTH; + return 1; +} + + +/* Read value of object. */ +static int read_obj(json_engine_t *j) +{ + j->state= JST_OBJ_START; + j->value_type= JSON_VALUE_OBJECT; + j->value= j->value_begin; + if (++j->stack_p < JSON_DEPTH_LIMIT) + { + j->stack[j->stack_p]= JST_OBJ_CONT; + return 0; + } + j->s.error= JE_DEPTH; + return 1; +} + + +/* Value of array. */ +static int mark_array(json_engine_t *j) +{ + j->state= JST_ARRAY_START; + if (++j->stack_p < JSON_DEPTH_LIMIT) + { + j->stack[j->stack_p]= JST_ARRAY_CONT; + j->value= j->value_begin; + return 0; + } + j->s.error= JE_DEPTH; + return 1; +} + +/* Read value of object. */ +static int read_array(json_engine_t *j) +{ + j->state= JST_ARRAY_START; + j->value_type= JSON_VALUE_ARRAY; + j->value= j->value_begin; + if (++j->stack_p < JSON_DEPTH_LIMIT) + { + j->stack[j->stack_p]= JST_ARRAY_CONT; + return 0; + } + j->s.error= JE_DEPTH; + return 1; +} + + + +/* + Character classes inside the JSON string constant. + We mostly need this to parse escaping properly. + Escapings availabe in JSON are: + \" - quotation mark + \\ - backslash + \b - backspace UNICODE 8 + \f - formfeed UNICODE 12 + \n - newline UNICODE 10 + \r - carriage return UNICODE 13 + \t - horizontal tab UNICODE 9 + \u{four-hex-digits} - code in UCS16 character set +*/ +enum json_string_char_classes { + S_0= 0, + S_1= 1, + S_2= 2, + S_3= 3, + S_4= 4, + S_5= 5, + S_6= 6, + S_7= 7, + S_8= 8, + S_9= 9, + S_A= 10, + S_B= 11, + S_C= 12, + S_D= 13, + S_E= 14, + S_F= 15, + S_ETC= 36, /* rest of characters. */ + S_QUOTE= 37, + S_BKSL= 38, /* \ */ + S_ERR= 100, /* disallowed */ +}; + + +/* This maps characters to their types inside a string constant. */ +static enum json_string_char_classes json_instr_chr_map[128] = { + S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, + S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, + S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, + S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, + + S_ETC, S_ETC, S_QUOTE, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, + S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, + S_0, S_1, S_2, S_3, S_4, S_5, S_6, S_7, + S_8, S_9, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, + + S_ETC, S_A, S_B, S_C, S_D, S_E, S_F, S_ETC, + S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, + S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, + S_ETC, S_ETC, S_ETC, S_ETC, S_BKSL, S_ETC, S_ETC, S_ETC, + + S_ETC, S_A, S_B, S_C, S_D, S_E, S_F, S_ETC, + S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, + S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, + S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC +}; + + +static int read_4_hexdigits(json_string_t *s, uchar *dest) +{ + int i, t, c_len; + for (i=0; i<4; i++) + { + if ((c_len= json_next_char(s)) <= 0) + return s->error= json_eos(s) ? JE_EOS : JE_BAD_CHR; + + if (s->c_next >= 128 || (t= json_instr_chr_map[s->c_next]) > S_F) + return s->error= JE_SYN; + + s->c_str+= c_len; + dest[i/2]+= (i % 2) ? t : t*16; + } + return 0; +} + + +static int json_handle_esc(json_string_t *s) +{ + int t, c_len; + + if ((c_len= json_next_char(s)) <= 0) + return s->error= json_eos(s) ? JE_EOS : JE_BAD_CHR; + + s->c_str+= c_len; + switch (s->c_next) + { + case 'b': + s->c_next= 8; + return 0; + case 'f': + s->c_next= 12; + return 0; + case 'n': + s->c_next= 10; + return 0; + case 'r': + s->c_next= 13; + return 0; + case 't': + s->c_next= 9; + return 0; + } + + if (s->c_next < 128 && (t= json_instr_chr_map[s->c_next]) == S_ERR) + { + s->c_str-= c_len; + return s->error= JE_ESCAPING; + } + + + if (s->c_next != 'u') + return 0; + + { + /* + Read the four-hex-digits code. + If symbol is not in the Basic Multilingual Plane, we're reading + the string for the next four digits to compose the UTF-16 surrogate pair. + */ + uchar code[4]= {0,0,0,0}; + + if (read_4_hexdigits(s, code)) + return 1; + + if ((c_len= my_utf16_uni(0, &s->c_next, code, code+2)) == 2) + return 0; + + if (c_len != MY_CS_TOOSMALL4) + return s->error= JE_BAD_CHR; + + if ((c_len= json_next_char(s)) <= 0) + return s->error= json_eos(s) ? JE_EOS : JE_BAD_CHR; + if (s->c_next != '\\') + return s->error= JE_SYN; + + if ((c_len= json_next_char(s)) <= 0) + return s->error= json_eos(s) ? JE_EOS : JE_BAD_CHR; + if (s->c_next != 'u') + return s->error= JE_SYN; + + if (read_4_hexdigits(s, code+2)) + return 1; + + if ((c_len= my_utf16_uni(0, &s->c_next, code, code+4)) == 2) + return 0; + } + return s->error= JE_BAD_CHR; +} + + +int json_read_string_const_chr(json_string_t *js) +{ + int c_len; + + if ((c_len= json_next_char(js)) > 0) + { + js->c_str+= c_len; + return (js->c_next == '\\') ? json_handle_esc(js) : 0; + } + js->error= json_eos(js) ? JE_EOS : JE_BAD_CHR; + return 1; +} + + +static int skip_str_constant(json_engine_t *j) +{ + int t, c_len; + for (;;) + { + if ((c_len= json_next_char(&j->s)) > 0) + { + j->s.c_str+= c_len; + if (j->s.c_next >= 128 || ((t=json_instr_chr_map[j->s.c_next]) <= S_ETC)) + continue; + + if (j->s.c_next == '"') + break; + if (j->s.c_next == '\\') + { + j->value_escaped= 1; + if (json_handle_esc(&j->s)) + return 1; + continue; + } + /* Symbol not allowed in JSON. */ + return j->s.error= JE_NOT_JSON_CHR; + } + else + return j->s.error= json_eos(&j->s) ? JE_EOS : JE_BAD_CHR; + } + + j->state= j->stack[j->stack_p]; + return 0; +} + + +/* Scalar string. */ +static int v_string(json_engine_t *j) +{ + return skip_str_constant(j) || json_scan_next(j); +} + + +/* Read scalar string. */ +static int read_strn(json_engine_t *j) +{ + j->value= j->s.c_str; + j->value_type= JSON_VALUE_STRING; + j->value_escaped= 0; + + if (skip_str_constant(j)) + return 1; + + j->state= j->stack[j->stack_p]; + j->value_len= (int)(j->s.c_str - j->value) - 1; + return 0; +} + + +/* + We have dedicated parser for numeric constants. It's similar + to the main JSON parser, we similarly define character classes, + map characters to classes and implement the state-per-class + table. Though we don't create functions that handle + particular classes, just specify what new state should parser + get in this case. +*/ +enum json_num_char_classes { + N_MINUS, + N_PLUS, + N_ZERO, + N_DIGIT, + N_POINT, + N_E, + N_END, + N_EEND, + N_ERR, + N_NUM_CLASSES +}; + + +static enum json_num_char_classes json_num_chr_map[128] = { + N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, + N_ERR, N_END, N_END, N_ERR, N_ERR, N_END, N_ERR, N_ERR, + N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, + N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, N_ERR, + + N_END, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, + N_EEND, N_EEND, N_EEND, N_PLUS, N_END, N_MINUS, N_POINT, N_EEND, + N_ZERO, N_DIGIT, N_DIGIT, N_DIGIT, N_DIGIT, N_DIGIT, N_DIGIT, N_DIGIT, + N_DIGIT, N_DIGIT, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, + + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_E, N_EEND, N_EEND, + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_END, N_EEND, N_EEND, + + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_E, N_EEND, N_EEND, + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, + N_EEND, N_EEND, N_EEND, N_EEND, N_EEND, N_END, N_EEND, N_EEND, +}; + + +enum json_num_states { + NS_OK, /* Number ended. */ + NS_GO, /* Initial state. */ + NS_GO1, /* If the number starts with '-'. */ + NS_Z, /* If the number starts with '0'. */ + NS_Z1, /* If the numbers starts with '-0'. */ + NS_INT, /* Integer part. */ + NS_FRAC,/* Fractional part. */ + NS_EX, /* Exponential part begins. */ + NS_EX1, /* Exponential part continues. */ + NS_NUM_STATES +}; + + +static int json_num_states[NS_NUM_STATES][N_NUM_CLASSES]= +{ +/* - + 0 1..9 POINT E END_OK ERROR */ +/*OK*/ { JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_BAD_CHR }, +/*GO*/ { NS_GO1, JE_SYN, NS_Z, NS_INT, JE_SYN, JE_SYN, JE_SYN, JE_BAD_CHR }, +/*GO1*/ { JE_SYN, JE_SYN, NS_Z1, NS_INT, JE_SYN, JE_SYN, JE_SYN, JE_BAD_CHR }, +/*ZERO*/ { JE_SYN, JE_SYN, JE_SYN, JE_SYN, NS_FRAC, JE_SYN, NS_OK, JE_BAD_CHR }, +/*ZE1*/ { JE_SYN, JE_SYN, JE_SYN, JE_SYN, NS_FRAC, JE_SYN, NS_OK, JE_BAD_CHR }, +/*INT*/ { JE_SYN, JE_SYN, NS_INT, NS_INT, NS_FRAC, NS_EX, NS_OK, JE_BAD_CHR }, +/*FRAC*/ { JE_SYN, JE_SYN, NS_FRAC, NS_FRAC,JE_SYN, NS_EX, NS_OK, JE_BAD_CHR }, +/*EX*/ { NS_EX, NS_EX, NS_EX1, NS_EX1, JE_SYN, JE_SYN, JE_SYN, JE_BAD_CHR }, +/*EX1*/ { JE_SYN, JE_SYN, NS_EX1, NS_EX1, JE_SYN, JE_SYN, NS_OK, JE_BAD_CHR } +}; + + +static uint json_num_state_flags[NS_NUM_STATES]= +{ +/*OK*/ 0, +/*GO*/ 0, +/*GO1*/ JSON_NUM_NEG, +/*ZERO*/ 0, +/*ZE1*/ 0, +/*INT*/ 0, +/*FRAC*/ JSON_NUM_FRAC_PART, +/*EX*/ JSON_NUM_EXP, +/*EX1*/ 0, +}; + + +static int skip_num_constant(json_engine_t *j) +{ + int state= json_num_states[NS_GO][json_num_chr_map[j->s.c_next]]; + int c_len; + + j->num_flags= 0; + for (;;) + { + j->num_flags|= json_num_state_flags[state]; + if ((c_len= json_next_char(&j->s)) > 0 && j->s.c_next < 128) + { + if ((state= json_num_states[state][json_num_chr_map[j->s.c_next]]) > 0) + { + j->s.c_str+= c_len; + continue; + } + break; + } + + if ((j->s.error= + json_eos(&j->s) ? json_num_states[state][N_END] : JE_BAD_CHR) < 0) + return 1; + else + break; + } + + j->state= j->stack[j->stack_p]; + return 0; +} + + +/* Scalar numeric. */ +static int v_number(json_engine_t *j) +{ + return skip_num_constant(j) || json_scan_next(j); +} + + +/* Read numeric constant. */ +static int read_num(json_engine_t *j) +{ + j->value= j->value_begin; + if (skip_num_constant(j) == 0) + { + j->value_type= JSON_VALUE_NUMBER; + j->value_len= (int)(j->s.c_str - j->value_begin); + return 0; + } + return 1; +} + + +/* Check that the JSON string matches the argument and skip it. */ +static int skip_string_verbatim(json_string_t *s, const char *str) +{ + int c_len; + while (*str) + { + if ((c_len= json_next_char(s)) > 0) + { + if (s->c_next == (my_wc_t) *(str++)) + { + s->c_str+= c_len; + continue; + } + return s->error= JE_SYN; + } + return s->error= json_eos(s) ? JE_EOS : JE_BAD_CHR; + } + + return 0; +} + + +/* Scalar false. */ +static int v_false(json_engine_t *j) +{ + if (skip_string_verbatim(&j->s, "alse")) + return 1; + j->state= j->stack[j->stack_p]; + return json_scan_next(j); +} + + +/* Scalar null. */ +static int v_null(json_engine_t *j) +{ + if (skip_string_verbatim(&j->s, "ull")) + return 1; + j->state= j->stack[j->stack_p]; + return json_scan_next(j); +} + + +/* Scalar true. */ +static int v_true(json_engine_t *j) +{ + if (skip_string_verbatim(&j->s, "rue")) + return 1; + j->state= j->stack[j->stack_p]; + return json_scan_next(j); +} + + +/* Read false. */ +static int read_false(json_engine_t *j) +{ + j->value_type= JSON_VALUE_FALSE; + j->value= j->value_begin; + j->state= j->stack[j->stack_p]; + j->value_len= 5; + return skip_string_verbatim(&j->s, "alse"); +} + + +/* Read null. */ +static int read_null(json_engine_t *j) +{ + j->value_type= JSON_VALUE_NULL; + j->value= j->value_begin; + j->state= j->stack[j->stack_p]; + j->value_len= 4; + return skip_string_verbatim(&j->s, "ull"); +} + + +/* Read true. */ +static int read_true(json_engine_t *j) +{ + j->value_type= JSON_VALUE_TRUE; + j->value= j->value_begin; + j->state= j->stack[j->stack_p]; + j->value_len= 4; + return skip_string_verbatim(&j->s, "rue"); +} + + +/* Disallowed character. */ +static int not_json_chr(json_engine_t *j) +{ + j->s.error= JE_NOT_JSON_CHR; + return 1; +} + + +/* Bad character. */ +static int bad_chr(json_engine_t *j) +{ + j->s.error= JE_BAD_CHR; + return 1; +} + + +/* Correct finish. */ +static int done(json_engine_t *j __attribute__((unused))) +{ + return 1; +} + + +/* End of the object. */ +static int end_object(json_engine_t *j) +{ + j->stack_p--; + j->state= JST_OBJ_END; + return 0; +} + + +/* End of the array. */ +static int end_array(json_engine_t *j) +{ + j->stack_p--; + j->state= JST_ARRAY_END; + return 0; +} + + +/* Start reading key name. */ +static int read_keyname(json_engine_t *j) +{ + j->state= JST_KEY; + return 0; +} + + +static void get_first_nonspace(json_string_t *js, int *t_next, int *c_len) +{ + do + { + if ((*c_len= json_next_char(js)) <= 0) + *t_next= json_eos(js) ? C_EOS : C_BAD; + else + { + *t_next= (js->c_next < 128) ? json_chr_map[js->c_next] : C_ETC; + js->c_str+= *c_len; + } + } while (*t_next == C_SPACE); +} + + +/* Next key name. */ +static int next_key(json_engine_t *j) +{ + int t_next, c_len; + get_first_nonspace(&j->s, &t_next, &c_len); + + if (t_next == C_QUOTE) + { + j->state= JST_KEY; + return 0; + } + + j->s.error= (t_next == C_EOS) ? JE_EOS : + ((t_next == C_BAD) ? JE_BAD_CHR : + JE_SYN); + return 1; +} + + +/* Forward declarations. */ +static int skip_colon(json_engine_t *j); +static int skip_key(json_engine_t *j); +static int struct_end_cb(json_engine_t *j); +static int struct_end_qb(json_engine_t *j); +static int struct_end_cm(json_engine_t *j); +static int struct_end_eos(json_engine_t *j); + + +static int next_item(json_engine_t *j) +{ + j->state= JST_VALUE; + return 0; +} + + +static int array_item(json_engine_t *j) +{ + j->state= JST_VALUE; + j->s.c_str-= j->sav_c_len; + return 0; +} + + +static json_state_handler json_actions[NR_JSON_STATES][NR_C_CLASSES]= +/* + EOS { } [ ] + : , " -0..9 f + n t ETC ERR BAD +*/ +{ + {/*VALUE*/ + unexpected_eos, mark_object, syntax_error, mark_array, syntax_error, + syntax_error, syntax_error,v_string, v_number, v_false, + v_null, v_true, syntax_error, not_json_chr, bad_chr}, + {/*KEY*/ + unexpected_eos, skip_key, skip_key, skip_key, skip_key, + skip_key, skip_key, skip_colon, skip_key, skip_key, + skip_key, skip_key, skip_key, not_json_chr, bad_chr}, + {/*OBJ_START*/ + unexpected_eos, syntax_error, end_object, syntax_error, syntax_error, + syntax_error, syntax_error, read_keyname, syntax_error, syntax_error, + syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, + {/*OBJ_END*/ + struct_end_eos, syntax_error, struct_end_cb, syntax_error, struct_end_qb, + syntax_error, struct_end_cm,syntax_error, syntax_error, syntax_error, + syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, + {/*ARRAY_START*/ + unexpected_eos, array_item, syntax_error, array_item, end_array, + syntax_error, syntax_error, array_item, array_item, array_item, + array_item, array_item, syntax_error, not_json_chr, bad_chr}, + {/*ARRAY_END*/ + struct_end_eos, syntax_error, struct_end_cb, syntax_error, struct_end_qb, + syntax_error, struct_end_cm, syntax_error, syntax_error, syntax_error, + syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, + {/*DONE*/ + done, syntax_error, syntax_error, syntax_error, syntax_error, + syntax_error, syntax_error, syntax_error, syntax_error, syntax_error, + syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, + {/*OBJ_CONT*/ + unexpected_eos, syntax_error, end_object, syntax_error, syntax_error, + syntax_error, next_key, syntax_error, syntax_error, syntax_error, + syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, + {/*ARRAY_CONT*/ + unexpected_eos, syntax_error, syntax_error, syntax_error, end_array, + syntax_error, next_item, syntax_error, syntax_error, syntax_error, + syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, + {/*READ_VALUE*/ + unexpected_eos, read_obj, syntax_error, read_array, syntax_error, + syntax_error, syntax_error, read_strn, read_num, read_false, + read_null, read_true, syntax_error, not_json_chr, bad_chr}, +}; + + + +int json_scan_start(json_engine_t *je, + CHARSET_INFO *i_cs, const uchar *str, const uchar *end) +{ + json_string_setup(&je->s, i_cs, str, end); + je->stack[0]= JST_DONE; + je->stack_p= 0; + je->state= JST_VALUE; + return 0; +} + + +/* Skip colon and the value. */ +static int skip_colon(json_engine_t *j) +{ + int t_next, c_len; + + get_first_nonspace(&j->s, &t_next, &c_len); + + if (t_next == C_COLON) + { + get_first_nonspace(&j->s, &t_next, &c_len); + return json_actions[JST_VALUE][t_next](j); + } + + j->s.error= (t_next == C_EOS) ? JE_EOS : + ((t_next == C_BAD) ? JE_BAD_CHR: + JE_SYN); + + return 1; +} + + +/* Skip colon and the value. */ +static int skip_key(json_engine_t *j) +{ + int t_next, c_len; + while (json_read_keyname_chr(j) == 0) {} + + if (j->s.error) + return 1; + + get_first_nonspace(&j->s, &t_next, &c_len); + return json_actions[JST_VALUE][t_next](j); +} + + +/* + Handle EOS after the end of an object or array. + To do that we should pop the stack to see if + we are inside an object, or an array, and + run our 'state machine' accordingly. +*/ +static int struct_end_eos(json_engine_t *j) +{ return json_actions[j->stack[j->stack_p]][C_EOS](j); } + + +/* + Handle '}' after the end of an object or array. + To do that we should pop the stack to see if + we are inside an object, or an array, and + run our 'state machine' accordingly. +*/ +static int struct_end_cb(json_engine_t *j) +{ return json_actions[j->stack[j->stack_p]][C_RCURB](j); } + + +/* + Handle ']' after the end of an object or array. + To do that we should pop the stack to see if + we are inside an object, or an array, and + run our 'state machine' accordingly. +*/ +static int struct_end_qb(json_engine_t *j) +{ return json_actions[j->stack[j->stack_p]][C_RSQRB](j); } + + +/* + Handle ',' after the end of an object or array. + To do that we should pop the stack to see if + we are inside an object, or an array, and + run our 'state machine' accordingly. +*/ +static int struct_end_cm(json_engine_t *j) +{ return json_actions[j->stack[j->stack_p]][C_COMMA](j); } + + +int json_read_keyname_chr(json_engine_t *j) +{ + int c_len, t; + + if ((c_len= json_next_char(&j->s)) > 0) + { + j->s.c_str+= c_len; + if (j->s.c_next>= 128 || (t= json_instr_chr_map[j->s.c_next]) <= S_ETC) + return 0; + + switch (t) + { + case S_QUOTE: + for (;;) /* Skip spaces until ':'. */ + { + if ((c_len= json_next_char(&j->s) > 0)) + { + if (j->s.c_next == ':') + { + j->s.c_str+= c_len; + j->state= JST_VALUE; + return 1; + } + + if (j->s.c_next < 128 && json_chr_map[j->s.c_next] == C_SPACE) + { + j->s.c_str+= c_len; + continue; + } + j->s.error= JE_SYN; + break; + } + j->s.error= json_eos(&j->s) ? JE_EOS : JE_BAD_CHR; + break; + } + return 1; + case S_BKSL: + return json_handle_esc(&j->s); + case S_ERR: + j->s.c_str-= c_len; + j->s.error= JE_STRING_CONST; + return 1; + } + } + j->s.error= json_eos(&j->s) ? JE_EOS : JE_BAD_CHR; + return 1; +} + + +int json_read_value(json_engine_t *j) +{ + int t_next, c_len, res; + + if (j->state == JST_KEY) + { + while (json_read_keyname_chr(j) == 0) {} + + if (j->s.error) + return 1; + } + + get_first_nonspace(&j->s, &t_next, &c_len); + + j->value_begin= j->s.c_str-c_len; + res= json_actions[JST_READ_VALUE][t_next](j); + j->value_end= j->s.c_str; + return res; +} + + +int json_scan_next(json_engine_t *j) +{ + int t_next; + + get_first_nonspace(&j->s, &t_next, &j->sav_c_len); + return json_actions[j->state][t_next](j); +} + + +enum json_path_chr_classes { + P_EOS, /* end of string */ + P_USD, /* $ */ + P_ASTER, /* * */ + P_LSQRB, /* [ */ + P_RSQRB, /* ] */ + P_POINT, /* . */ + P_ZERO, /* 0 */ + P_DIGIT, /* 123456789 */ + P_L, /* l (for "lax") */ + P_S, /* s (for "strict") */ + P_SPACE, /* space */ + P_BKSL, /* \ */ + P_QUOTE, /* " */ + P_ETC, /* everything else */ + P_ERR, /* character disallowed in JSON*/ + P_BAD, /* invalid character */ + N_PATH_CLASSES, +}; + + +static enum json_path_chr_classes json_path_chr_map[128] = { + P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, + P_ERR, P_SPACE, P_SPACE, P_ERR, P_ERR, P_SPACE, P_ERR, P_ERR, + P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, + P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, P_ERR, + + P_SPACE, P_ETC, P_QUOTE, P_ETC, P_USD, P_ETC, P_ETC, P_ETC, + P_ETC, P_ETC, P_ASTER, P_ETC, P_ETC, P_ETC, P_POINT, P_ETC, + P_ZERO, P_DIGIT, P_DIGIT, P_DIGIT, P_DIGIT, P_DIGIT, P_DIGIT, P_DIGIT, + P_DIGIT, P_DIGIT, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, + + P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, + P_ETC, P_ETC, P_ETC, P_ETC, P_L, P_ETC, P_ETC, P_ETC, + P_ETC, P_ETC, P_S, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, + P_ETC, P_ETC, P_ETC, P_LSQRB, P_BKSL, P_RSQRB, P_ETC, P_ETC, + + P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, + P_ETC, P_ETC, P_ETC, P_ETC, P_L, P_ETC, P_ETC, P_ETC, + P_ETC, P_ETC, P_S, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, + P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC, P_ETC +}; + + +enum json_path_states { + PS_GO, /* Initial state. */ + PS_LAX, /* Parse the 'lax' keyword. */ + PS_PT, /* New path's step begins. */ + PS_AR, /* Parse array step. */ + PS_SAR, /* space after the '['. */ + PS_AWD, /* Array wildcard. */ + PS_Z, /* '0' (as an array item number). */ + PS_INT, /* Parse integer (as an array item number). */ + PS_AS, /* Space. */ + PS_KEY, /* Key. */ + PS_KNM, /* Parse key name. */ + PS_KWD, /* Key wildcard. */ + PS_AST, /* Asterisk. */ + PS_DWD, /* Double wildcard. */ + PS_KEYX, /* Key started with quote ("). */ + PS_KNMX, /* Parse quoted key name. */ + N_PATH_STATES, /* Below are states that aren't in the transitions table. */ + PS_SCT, /* Parse the 'strict' keyword. */ + PS_EKY, /* '.' after the keyname so next step is the key. */ + PS_EKYX, /* Closing " for the quoted keyname. */ + PS_EAR, /* '[' after the keyname so next step is the array. */ + PS_ESC, /* Escaping in the keyname. */ + PS_ESCX, /* Escaping in the quoted keyname. */ + PS_OK, /* Path normally ended. */ + PS_KOK /* EOS after the keyname so end the path normally. */ +}; + + +static int json_path_transitions[N_PATH_STATES][N_PATH_CLASSES]= +{ +/* + EOS $, * [ ] . 0 + 1..9 L S SPACE \ " ETC + ERR BAD +*/ +/* GO */ { JE_EOS, PS_PT, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_SYN, PS_LAX, PS_SCT, PS_GO, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* LAX */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_SYN, PS_LAX, JE_SYN, PS_GO, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* PT */ { PS_OK, JE_SYN, PS_AST, PS_AR, JE_SYN, PS_KEY, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* AR */ { JE_EOS, JE_SYN, PS_AWD, JE_SYN, JE_SYN, JE_SYN, PS_Z, + PS_INT, JE_SYN, JE_SYN, PS_SAR, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* SAR */ { JE_EOS, JE_SYN, PS_AWD, JE_SYN, PS_PT, JE_SYN, PS_Z, + PS_INT, JE_SYN, JE_SYN, PS_SAR, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* AWD */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_PT, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, PS_AS, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* Z */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_PT, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, PS_AS, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* INT */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_PT, JE_SYN, PS_INT, + PS_INT, JE_SYN, JE_SYN, PS_AS, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* AS */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_PT, JE_SYN, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, PS_AS, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* KEY */ { JE_EOS, PS_KNM, PS_KWD, JE_SYN, PS_KNM, JE_SYN, PS_KNM, + PS_KNM, PS_KNM, PS_KNM, PS_KNM, JE_SYN, PS_KEYX, PS_KNM, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* KNM */ { PS_KOK, PS_KNM, PS_AST, PS_EAR, PS_KNM, PS_EKY, PS_KNM, + PS_KNM, PS_KNM, PS_KNM, PS_KNM, PS_ESC, PS_KNM, PS_KNM, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* KWD */ { PS_OK, JE_SYN, JE_SYN, PS_AR, JE_SYN, PS_EKY, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* AST */ { JE_SYN, JE_SYN, PS_DWD, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* DWD */ { JE_SYN, JE_SYN, PS_AST, PS_AR, JE_SYN, PS_KEY, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* KEYX*/ { JE_EOS, PS_KNMX, PS_KNMX, PS_KNMX, PS_KNMX, PS_KNMX, PS_KNMX, + PS_KNMX,PS_KNMX, PS_KNMX, PS_KNMX, PS_ESCX, PS_EKYX, PS_KNMX, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +/* KNMX */{ JE_EOS, PS_KNMX, PS_KNMX, PS_KNMX, PS_KNMX, PS_KNMX, PS_KNMX, + PS_KNMX, PS_KNMX, PS_KNMX, PS_KNMX,PS_ESCX, PS_EKYX, PS_KNMX, + JE_NOT_JSON_CHR, JE_BAD_CHR}, +}; + + +int json_path_setup(json_path_t *p, + CHARSET_INFO *i_cs, const uchar *str, const uchar *end) +{ + int c_len, t_next, state= PS_GO; + enum json_path_step_types double_wildcard= JSON_PATH_KEY_NULL; + + json_string_setup(&p->s, i_cs, str, end); + + p->steps[0].type= JSON_PATH_ARRAY_WILD; + p->last_step= p->steps; + p->mode_strict= FALSE; + p->types_used= JSON_PATH_KEY_NULL; + + do + { + if ((c_len= json_next_char(&p->s)) <= 0) + t_next= json_eos(&p->s) ? P_EOS : P_BAD; + else + t_next= (p->s.c_next >= 128) ? P_ETC : json_path_chr_map[p->s.c_next]; + + if ((state= json_path_transitions[state][t_next]) < 0) + return p->s.error= state; + + p->s.c_str+= c_len; + + switch (state) + { + case PS_LAX: + if ((p->s.error= skip_string_verbatim(&p->s, "ax"))) + return 1; + p->mode_strict= FALSE; + continue; + case PS_SCT: + if ((p->s.error= skip_string_verbatim(&p->s, "rict"))) + return 1; + p->mode_strict= TRUE; + state= PS_LAX; + continue; + case PS_KWD: + case PS_AWD: + p->last_step->type|= JSON_PATH_WILD; + p->types_used|= JSON_PATH_WILD; + continue; + case PS_INT: + p->last_step->n_item*= 10; + p->last_step->n_item+= p->s.c_next - '0'; + continue; + case PS_EKYX: + p->last_step->key_end= p->s.c_str - c_len; + state= PS_PT; + continue; + case PS_EKY: + p->last_step->key_end= p->s.c_str - c_len; + state= PS_KEY; + /* fall through */ + case PS_KEY: + p->last_step++; + if (p->last_step - p->steps >= JSON_DEPTH_LIMIT) + return p->s.error= JE_DEPTH; + p->types_used|= p->last_step->type= JSON_PATH_KEY | double_wildcard; + double_wildcard= JSON_PATH_KEY_NULL; + /* fall through */ + case PS_KEYX: + p->last_step->key= p->s.c_str; + continue; + case PS_EAR: + p->last_step->key_end= p->s.c_str - c_len; + state= PS_AR; + /* fall through */ + case PS_AR: + p->last_step++; + if (p->last_step - p->steps >= JSON_DEPTH_LIMIT) + return p->s.error= JE_DEPTH; + p->types_used|= p->last_step->type= JSON_PATH_ARRAY | double_wildcard; + double_wildcard= JSON_PATH_KEY_NULL; + p->last_step->n_item= 0; + continue; + case PS_ESC: + if (json_handle_esc(&p->s)) + return 1; + state= PS_KNM; + continue; + case PS_ESCX: + if (json_handle_esc(&p->s)) + return 1; + state= PS_KNMX; + continue; + case PS_KOK: + p->last_step->key_end= p->s.c_str - c_len; + state= PS_OK; + break; /* 'break' as the loop supposed to end after that. */ + case PS_DWD: + double_wildcard= JSON_PATH_DOUBLE_WILD; + continue; + }; + } while (state != PS_OK); + + return double_wildcard ? (p->s.error= JE_SYN) : 0; +} + + +int json_skip_to_level(json_engine_t *j, int level) +{ + do { + if (j->stack_p < level) + return 0; + } while (json_scan_next(j) == 0); + + return 1; +} + + +/* + works as json_skip_level() but also counts items on the current + level skipped. +*/ +int json_skip_level_and_count(json_engine_t *j, int *n_items_skipped) +{ + int level= j->stack_p; + + *n_items_skipped= 0; + while (json_scan_next(j) == 0) + { + if (j->stack_p < level) + return 0; + if (j->stack_p == level && j->state == JST_VALUE) + (*n_items_skipped)++; + } + + return 1; +} + + +int json_skip_key(json_engine_t *j) +{ + if (json_read_value(j)) + return 1; + + if (json_value_scalar(j)) + return 0; + + return json_skip_level(j); +} + + +#define SKIPPED_STEP_MARK ((uint) ~0) + +/* + Current step of the patch matches the JSON construction. + Now we should either stop the search or go to the next + step of the path. +*/ +static int handle_match(json_engine_t *je, json_path_t *p, + json_path_step_t **p_cur_step, uint *array_counters) +{ + json_path_step_t *next_step= *p_cur_step + 1; + + DBUG_ASSERT(*p_cur_step < p->last_step); + + if (json_read_value(je)) + return 1; + + if (json_value_scalar(je)) + { + while (next_step->type == JSON_PATH_ARRAY && next_step->n_item == 0) + { + if (++next_step > p->last_step) + { + je->s.c_str= je->value_begin; + return 1; + } + } + return 0; + } + + if (next_step->type == JSON_PATH_ARRAY && next_step->n_item == 0 && + je->value_type & JSON_VALUE_OBJECT) + { + do + { + array_counters[next_step - p->steps]= SKIPPED_STEP_MARK; + if (++next_step > p->last_step) + { + je->s.c_str= je->value_begin; + je->stack_p--; + return 1; + } + } while (next_step->type == JSON_PATH_ARRAY && next_step->n_item == 0); + } + + + array_counters[next_step - p->steps]= 0; + + if ((int) je->value_type != + (int) (next_step->type & JSON_PATH_KEY_OR_ARRAY)) + return json_skip_level(je); + + *p_cur_step= next_step; + return 0; +} + + +/* + Check if the name of the current JSON key matches + the step of the path. +*/ +int json_key_matches(json_engine_t *je, json_string_t *k) +{ + while (json_read_keyname_chr(je) == 0) + { + if (json_read_string_const_chr(k) || + je->s.c_next != k->c_next) + return 0; + } + + return json_read_string_const_chr(k); +} + + +int json_find_path(json_engine_t *je, + json_path_t *p, json_path_step_t **p_cur_step, + uint *array_counters) +{ + json_string_t key_name; + + json_string_set_cs(&key_name, p->s.cs); + + do + { + json_path_step_t *cur_step= *p_cur_step; + switch (je->state) + { + case JST_KEY: + DBUG_ASSERT(cur_step->type & JSON_PATH_KEY); + if (!(cur_step->type & JSON_PATH_WILD)) + { + json_string_set_str(&key_name, cur_step->key, cur_step->key_end); + if (!json_key_matches(je, &key_name)) + { + if (json_skip_key(je)) + goto exit; + continue; + } + } + if (cur_step == p->last_step || + handle_match(je, p, p_cur_step, array_counters)) + goto exit; + break; + case JST_VALUE: + DBUG_ASSERT(cur_step->type & JSON_PATH_ARRAY); + if (cur_step->type & JSON_PATH_WILD || + cur_step->n_item == array_counters[cur_step - p->steps]++) + { + /* Array item matches. */ + if (cur_step == p->last_step || + handle_match(je, p, p_cur_step, array_counters)) + goto exit; + } + else + json_skip_array_item(je); + break; + case JST_OBJ_END: + do + { + (*p_cur_step)--; + } while (*p_cur_step > p->steps && + array_counters[*p_cur_step - p->steps] == SKIPPED_STEP_MARK); + break; + case JST_ARRAY_END: + (*p_cur_step)--; + break; + default: + DBUG_ASSERT(0); + break; + }; + } while (json_scan_next(je) == 0); + + /* No luck. */ + return 1; + +exit: + return je->s.error; +} + + +int json_find_paths_first(json_engine_t *je, json_find_paths_t *state, + uint n_paths, json_path_t *paths, uint *path_depths) +{ + state->n_paths= n_paths; + state->paths= paths; + state->cur_depth= 0; + state->path_depths= path_depths; + return json_find_paths_next(je, state); +} + + +int json_find_paths_next(json_engine_t *je, json_find_paths_t *state) +{ + uint p_c; + int path_found, no_match_found; + do + { + switch (je->state) + { + case JST_KEY: + path_found= FALSE; + no_match_found= TRUE; + for (p_c=0; p_c < state->n_paths; p_c++) + { + json_path_step_t *cur_step; + if (state->path_depths[p_c] < + state->cur_depth /* Path already failed. */ || + !((cur_step= state->paths[p_c].steps + state->cur_depth)->type & + JSON_PATH_KEY)) + continue; + + if (!(cur_step->type & JSON_PATH_WILD)) + { + json_string_t key_name; + json_string_setup(&key_name, state->paths[p_c].s.cs, + cur_step->key, cur_step->key_end); + if (!json_key_matches(je, &key_name)) + continue; + } + if (cur_step == state->paths[p_c].last_step + state->cur_depth) + path_found= TRUE; + else + { + no_match_found= FALSE; + state->path_depths[p_c]= state->cur_depth + 1; + } + } + if (path_found) + /* Return the result. */ + goto exit; + if (no_match_found) + { + /* No possible paths left to check. Just skip the level. */ + if (json_skip_level(je)) + goto exit; + } + + break; + case JST_VALUE: + path_found= FALSE; + no_match_found= TRUE; + for (p_c=0; p_c < state->n_paths; p_c++) + { + json_path_step_t *cur_step; + if (state->path_depths[p_c]< state->cur_depth /* Path already failed. */ || + !((cur_step= state->paths[p_c].steps + state->cur_depth)->type & + JSON_PATH_ARRAY)) + continue; + if (cur_step->type & JSON_PATH_WILD || + cur_step->n_item == state->array_counters[state->cur_depth]) + { + /* Array item matches. */ + if (cur_step == state->paths[p_c].last_step + state->cur_depth) + path_found= TRUE; + else + { + no_match_found= FALSE; + state->path_depths[p_c]= state->cur_depth + 1; + } + } + } + + if (path_found) + goto exit; + + if (no_match_found) + json_skip_array_item(je); + + state->array_counters[state->cur_depth]++; + break; + case JST_OBJ_START: + case JST_ARRAY_START: + for (p_c=0; p_c < state->n_paths; p_c++) + { + if (state->path_depths[p_c] < state->cur_depth) + /* Path already failed. */ + continue; + if (state->paths[p_c].steps[state->cur_depth].type & + ((je->state == JST_OBJ_START) ? JSON_PATH_KEY : JSON_PATH_ARRAY)) + state->path_depths[p_c]++; + } + state->cur_depth++; + break; + case JST_OBJ_END: + case JST_ARRAY_END: + for (p_c=0; p_c < state->n_paths; p_c++) + { + if (state->path_depths[p_c] < state->cur_depth) + continue; + state->path_depths[p_c]--; + } + state->cur_depth--; + break; + default: + DBUG_ASSERT(0); + break; + }; + } while (json_scan_next(je) == 0); + + /* No luck. */ + return 1; + +exit: + return je->s.error; +} + + +int json_append_ascii(CHARSET_INFO *json_cs, + uchar *json, uchar *json_end, + const uchar *ascii, const uchar *ascii_end) +{ + const uchar *json_start= json; + while (ascii < ascii_end) + { + int c_len; + if ((c_len= json_cs->cset->wc_mb(json_cs, (my_wc_t) *ascii, + json, json_end)) > 0) + { + json+= c_len; + ascii++; + continue; + } + + /* Error return. */ + return c_len; + } + + return (int)(json - json_start); +} + + +int json_unescape(CHARSET_INFO *json_cs, + const uchar *json_str, const uchar *json_end, + CHARSET_INFO *res_cs, uchar *res, uchar *res_end) +{ + json_string_t s; + const uchar *res_b= res; + + json_string_setup(&s, json_cs, json_str, json_end); + while (json_read_string_const_chr(&s) == 0) + { + int c_len; + if ((c_len= res_cs->cset->wc_mb(res_cs, s.c_next, res, res_end)) > 0) + { + res+= c_len; + continue; + } + if (c_len == MY_CS_ILUNI) + { + /* + Result charset doesn't support the json's character. + Let's replace it with the '?' symbol. + */ + if ((c_len= res_cs->cset->wc_mb(res_cs, '?', res, res_end)) > 0) + { + res+= c_len; + continue; + } + } + /* Result buffer is too small. */ + return -1; + } + + return s.error==JE_EOS ? (int)(res - res_b) : -1; +} + + +/* When we need to replace a character with the escaping. */ +enum json_esc_char_classes { + ESC_= 0, /* No need to escape. */ + ESC_U= 'u', /* Character not allowed in JSON. Always escape as \uXXXX. */ + ESC_B= 'b', /* Backspace. Escape as \b */ + ESC_F= 'f', /* Formfeed. Escape as \f */ + ESC_N= 'n', /* Newline. Escape as \n */ + ESC_R= 'r', /* Return. Escape as \r */ + ESC_T= 't', /* Tab. Escape as \s */ + ESC_BS= '\\' /* Backslash or '"'. Escape by the \\ prefix. */ +}; + + +/* This specifies how we should escape the character. */ +static enum json_esc_char_classes json_escape_chr_map[0x60] = { + ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, + ESC_B, ESC_T, ESC_N, ESC_U, ESC_F, ESC_R, ESC_U, ESC_U, + ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, + ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, ESC_U, + + ESC_, ESC_, ESC_BS, ESC_, ESC_, ESC_, ESC_, ESC_, + ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, + ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, + ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, + + ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, + ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, + ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, ESC_, + ESC_, ESC_, ESC_, ESC_, ESC_BS, ESC_, ESC_, ESC_, +}; + + +static const char hexconv[16] = "0123456789ABCDEF"; + + +int json_escape(CHARSET_INFO *str_cs, + const uchar *str, const uchar *str_end, + CHARSET_INFO *json_cs, uchar *json, uchar *json_end) +{ + const uchar *json_start= json; + + while (str < str_end) + { + my_wc_t c_chr; + int c_len; + if ((c_len= str_cs->cset->mb_wc(str_cs, &c_chr, str, str_end)) > 0) + { + enum json_esc_char_classes c_class; + + str+= c_len; + if (c_chr >= 0x60 || (c_class= json_escape_chr_map[c_chr]) == ESC_) + { + if ((c_len= json_cs->cset->wc_mb(json_cs, c_chr, json, json_end)) > 0) + { + json+= c_len; + continue; + } + if (c_len < 0) + { + /* JSON buffer is depleted. */ + return -1; + } + + /* JSON charset cannot convert this character. */ + c_class= ESC_U; + } + + if ((c_len= json_cs->cset->wc_mb(json_cs, '\\', json, json_end)) <= 0 || + (c_len= json_cs->cset->wc_mb(json_cs, + (c_class == ESC_BS) ? c_chr : c_class, + json+= c_len, json_end)) <= 0) + { + /* JSON buffer is depleted. */ + return -1; + } + json+= c_len; + + if (c_class != ESC_U) + continue; + + { + /* We have to use /uXXXX escaping. */ + uchar utf16buf[4]; + uchar code_str[8]; + int u_len= my_uni_utf16(0, c_chr, utf16buf, utf16buf + 4); + + code_str[0]= hexconv[utf16buf[0] >> 4]; + code_str[1]= hexconv[utf16buf[0] & 15]; + code_str[2]= hexconv[utf16buf[1] >> 4]; + code_str[3]= hexconv[utf16buf[1] & 15]; + + if (u_len > 2) + { + code_str[4]= hexconv[utf16buf[2] >> 4]; + code_str[5]= hexconv[utf16buf[2] & 15]; + code_str[6]= hexconv[utf16buf[3] >> 4]; + code_str[7]= hexconv[utf16buf[3] & 15]; + } + + if ((c_len= json_append_ascii(json_cs, json, json_end, + code_str, code_str+u_len*2)) > 0) + { + json+= c_len; + continue; + } + /* JSON buffer is depleted. */ + return -1; + } + } + else /* c_len == 0, an illegal symbol. */ + return -1; + } + + return (int)(json - json_start); +} + + +int json_get_path_start(json_engine_t *je, CHARSET_INFO *i_cs, + const uchar *str, const uchar *end, + json_path_t *p) +{ + json_scan_start(je, i_cs, str, end); + p->last_step= p->steps - 1; + return 0; +} + + +int json_get_path_next(json_engine_t *je, json_path_t *p) +{ + if (p->last_step < p->steps) + { + if (json_read_value(je)) + return 1; + + p->last_step= p->steps; + p->steps[0].type= JSON_PATH_ARRAY_WILD; + p->steps[0].n_item= 0; + return 0; + } + else + { + if (json_value_scalar(je)) + { + if (p->last_step->type & JSON_PATH_ARRAY) + p->last_step->n_item++; + } + else + { + p->last_step++; + p->last_step->type= (enum json_path_step_types) je->value_type; + p->last_step->n_item= 0; + } + + if (json_scan_next(je)) + return 1; + } + + do + { + switch (je->state) + { + case JST_KEY: + p->last_step->key= je->s.c_str; + do + { + p->last_step->key_end= je->s.c_str; + } while (json_read_keyname_chr(je) == 0); + if (je->s.error) + return 1; + /* Now we have je.state == JST_VALUE, so let's handle it. */ + + /* fall through */ + case JST_VALUE: + if (json_read_value(je)) + return 1; + return 0; + case JST_OBJ_END: + case JST_ARRAY_END: + p->last_step--; + if (p->last_step->type & JSON_PATH_ARRAY) + p->last_step->n_item++; + break; + default: + break; + } + } while (json_scan_next(je) == 0); + + return 1; +} + + +int json_path_parts_compare( + const json_path_step_t *a, const json_path_step_t *a_end, + const json_path_step_t *b, const json_path_step_t *b_end, + enum json_value_types vt) +{ + int res, res2; + + while (a <= a_end) + { + if (b > b_end) + { + while (vt != JSON_VALUE_ARRAY && + (a->type & JSON_PATH_ARRAY_WILD) == JSON_PATH_ARRAY && + a->n_item == 0) + { + if (++a > a_end) + return 0; + } + return -2; + } + + DBUG_ASSERT((b->type & (JSON_PATH_WILD | JSON_PATH_DOUBLE_WILD)) == 0); + + + if (a->type & JSON_PATH_ARRAY) + { + if (b->type & JSON_PATH_ARRAY) + { + if ((a->type & JSON_PATH_WILD) || a->n_item == b->n_item) + goto step_fits; + goto step_failed; + } + if ((a->type & JSON_PATH_WILD) == 0 && a->n_item == 0) + goto step_fits_autowrap; + goto step_failed; + } + else /* JSON_PATH_KEY */ + { + if (!(b->type & JSON_PATH_KEY)) + goto step_failed; + + if (!(a->type & JSON_PATH_WILD) && + (a->key_end - a->key != b->key_end - b->key || + memcmp(a->key, b->key, a->key_end - a->key) != 0)) + goto step_failed; + + goto step_fits; + } +step_failed: + if (!(a->type & JSON_PATH_DOUBLE_WILD)) + return -1; + b++; + continue; + +step_fits: + b++; + if (!(a->type & JSON_PATH_DOUBLE_WILD)) + { + a++; + continue; + } + + /* Double wild handling needs recursions. */ + res= json_path_parts_compare(a+1, a_end, b, b_end, vt); + if (res == 0) + return 0; + + res2= json_path_parts_compare(a, a_end, b, b_end, vt); + + return (res2 >= 0) ? res2 : res; + +step_fits_autowrap: + if (!(a->type & JSON_PATH_DOUBLE_WILD)) + { + a++; + continue; + } + + /* Double wild handling needs recursions. */ + res= json_path_parts_compare(a+1, a_end, b+1, b_end, vt); + if (res == 0) + return 0; + + res2= json_path_parts_compare(a, a_end, b+1, b_end, vt); + + return (res2 >= 0) ? res2 : res; + + } + + return b <= b_end; +} + + +int json_path_compare(const json_path_t *a, const json_path_t *b, + enum json_value_types vt) +{ + return json_path_parts_compare(a->steps+1, a->last_step, + b->steps+1, b->last_step, vt); +} + diff --git a/strings/my_strchr.c b/strings/my_strchr.c index 3ff7c32f482..6b1564c7ee1 100644 --- a/strings/my_strchr.c +++ b/strings/my_strchr.c @@ -38,7 +38,7 @@ const char *acc_end= (ACC) + (LEN); \ for (ptr_str= (STR) ; ptr_str < (END) ; ptr_str+= mbl) \ { \ - mbl= my_mbcharlen((CS), *(uchar*)ptr_str); \ + mbl= my_charlen_fix((CS), ptr_str, (END)); \ if (mbl < 2) \ { \ DBUG_ASSERT(mbl == 1); \ @@ -63,10 +63,9 @@ end: \ char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, pchar c) { - uint mbl; while (str < end) { - mbl= my_mbcharlen(cs, *(uchar *)str); + uint mbl= my_ismbchar(cs, str, end); if (mbl < 2) { if (*str == c) diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index c31ae91921d..fd2de08a38a 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2009-2011, Monty Program Ab + Copyright (c) 2009, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,11 +16,10 @@ #include "strings_def.h" #include <m_ctype.h> -#include <stdarg.h> #include <my_sys.h> #include <my_base.h> #include <my_handler_errors.h> - +#include <mysql_com.h> /* For FLOATING_POINT_DECIMALS */ #define MAX_ARGS 32 /* max positional args count*/ #define MAX_PRINT_INFO 32 /* max print position count */ @@ -93,10 +92,10 @@ static const char *get_length(const char *fmt, size_t *length, uint *pre_zero) */ static const char *get_length_arg(const char *fmt, ARGS_INFO *args_arr, - uint *arg_count, size_t *length, uint *flags) + size_t *arg_count, size_t *length, uint *flags) { fmt= get_length(fmt+1, length, flags); - *arg_count= MY_MAX(*arg_count, (uint) *length); + *arg_count= MY_MAX(*arg_count, *length); (*length)--; DBUG_ASSERT(*fmt == '$' && *length < MAX_ARGS); args_arr[*length].arg_type= 'd'; @@ -154,12 +153,15 @@ static const char *check_longlong(const char *fmt, uint *have_longlong) */ static char *backtick_string(CHARSET_INFO *cs, char *to, const char *end, - char *par, size_t par_len, char quote_char) + char *par, size_t par_len, char quote_char, + my_bool cut) { + char *last[3]= {0,0,0}; uint char_len; char *start= to; char *par_end= par + par_len; size_t buff_length= (size_t) (end - to); + uint index= 0; if (buff_length <= par_len) goto err; @@ -168,8 +170,12 @@ static char *backtick_string(CHARSET_INFO *cs, char *to, const char *end, for ( ; par < par_end; par+= char_len) { uchar c= *(uchar *) par; - if (!(char_len= my_mbcharlen(cs, c))) - char_len= 1; + if (cut) + { + last[index]= start; + index= (index + 1) % 3; + } + char_len= my_charlen_fix(cs, par, par_end); if (char_len == 1 && c == (uchar) quote_char ) { if (start + 1 >= end) @@ -180,9 +186,30 @@ static char *backtick_string(CHARSET_INFO *cs, char *to, const char *end, goto err; start= strnmov(start, par, char_len); } - + if (start + 1 >= end) goto err; + + if (cut) + { + uint dots= 0; + start= NULL; + for (; dots < 3; dots++) + { + if (index == 0) + index= 2; + else + index--; + if (!last[index]) + break; + start= last[index]; + } + if (start == NULL) + goto err; // there was no characters at all + for (; dots; dots--) + *start++= '.'; + + } *start++= quote_char; return start; @@ -197,22 +224,59 @@ err: */ static char *process_str_arg(CHARSET_INFO *cs, char *to, const char *end, - size_t width, char *par, uint print_type) + size_t width, char *par, uint print_type, + my_bool nice_cut) { int well_formed_error; - size_t plen, left_len= (size_t) (end - to) + 1; + uint dots= 0; + size_t plen, left_len= (size_t) (end - to) + 1, slen=0; if (!par) par = (char*) "(null)"; - plen= strnlen(par, width); - if (left_len <= plen) - plen = left_len - 1; - plen= cs->cset->well_formed_len(cs, par, par + plen, - width, &well_formed_error); + if (nice_cut) + { + plen= slen= strnlen(par, width + 1); + if (plen > width) + plen= width; + if (left_len <= plen) + plen = left_len - 1; + if ((slen > plen)) + { + if (plen < 3) + { + dots= (uint) plen; + plen= 0; + } + else + { + dots= 3; + plen-= 3; + } + } + } + else + { + plen= slen= strnlen(par, width); + dots= 0; + if (left_len <= plen) + plen = left_len - 1; + } + + plen= my_well_formed_length(cs, par, par + plen, width, &well_formed_error); if (print_type & ESCAPED_ARG) - to= backtick_string(cs, to, end, par, plen, '`'); + { + to= backtick_string(cs, to, end, par, plen + dots, '`', MY_TEST(dots)); + dots= 0; + } else to= strnmov(to,par,plen); + + if (dots) + { + for (; dots; dots--) + *(to++)= '.'; + *(to)= 0; + } return to; } @@ -241,8 +305,8 @@ static char *process_dbl_arg(char *to, char *end, size_t width, { if (width == MAX_WIDTH) width= FLT_DIG; /* width not set, use default */ - else if (width >= NOT_FIXED_DEC) - width= NOT_FIXED_DEC - 1; /* max.precision for my_fcvt() */ + else if (width >= FLOATING_POINT_DECIMALS) + width= FLOATING_POINT_DECIMALS - 1; /* max.precision for my_fcvt() */ width= MY_MIN(width, (size_t)(end-to) - 1); if (arg_type == 'f') @@ -333,7 +397,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end, { ARGS_INFO args_arr[MAX_ARGS]; PRINT_INFO print_arr[MAX_PRINT_INFO]; - uint idx= 0, arg_count= arg_index; + size_t idx= 0, arg_count= arg_index; start: /* Here we are at the beginning of positional argument, right after $ */ @@ -393,6 +457,7 @@ start: switch (args_arr[i].arg_type) { case 's': case 'b': + case 'T': args_arr[i].str_arg= va_arg(ap, char *); break; case 'f': @@ -427,12 +492,14 @@ start: size_t width= 0, length= 0; switch (print_arr[i].arg_type) { case 's': + case 'T': { char *par= args_arr[print_arr[i].arg_idx].str_arg; width= (print_arr[i].flags & WIDTH_ARG) ? (size_t)args_arr[print_arr[i].width].longlong_arg : print_arr[i].width; - to= process_str_arg(cs, to, end, width, par, print_arr[i].flags); + to= process_str_arg(cs, to, end, width, par, print_arr[i].flags, + (print_arr[i].arg_type == 'T')); break; } case 'b': @@ -497,9 +564,9 @@ start: char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; *to++= '"'; - my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); + my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg); to= process_str_arg(cs, to, real_end, width, errmsg_buff, - print_arr[i].flags); + print_arr[i].flags, 1); if (real_end > to) *to++= '"'; } break; @@ -623,10 +690,10 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, fmt= check_longlong(fmt, &have_longlong); - if (*fmt == 's') /* String parameter */ + if (*fmt == 's' || *fmt == 'T') /* String parameter */ { reg2 char *par= va_arg(ap, char *); - to= process_str_arg(cs, to, end, width, par, print_type); + to= process_str_arg(cs, to, end, width, par, print_type, (*fmt == 'T')); continue; } else if (*fmt == 'b') /* Buffer parameter */ @@ -637,7 +704,13 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, } else if (*fmt == 'f' || *fmt == 'g') { +#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */ + __msan_check_mem_is_initialized(ap, sizeof(double)); +#endif double d= va_arg(ap, double); +#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */ + __msan_unpoison(&d, sizeof(double)); +#endif to= process_dbl_arg(to, end, width, d, *fmt); continue; } @@ -677,8 +750,9 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; *to++= '"'; - my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); - to= process_str_arg(cs, to, real_end, width, errmsg_buff, print_type); + my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg); + to= process_str_arg(cs, to, real_end, width, errmsg_buff, + print_type, 1); if (real_end > to) *to++= '"'; } continue; @@ -793,7 +867,7 @@ int my_fprintf(FILE *stream, const char* format, ...) @param nr Error number */ -void my_strerror(char *buf, size_t len, int nr) +const char* my_strerror(char *buf, size_t len, int nr) { char *msg= NULL; @@ -805,7 +879,7 @@ void my_strerror(char *buf, size_t len, int nr) "Internal error/check (Not system error)" : "Internal error < 0 (Not system error)"), len-1); - return; + return buf; } /* @@ -846,4 +920,5 @@ void my_strerror(char *buf, size_t len, int nr) */ if (!buf[0]) strmake(buf, "unknown error", len - 1); + return buf; } diff --git a/strings/strcoll.ic b/strings/strcoll.ic index b0556cfac43..eb5b3d5fe9b 100644 --- a/strings/strcoll.ic +++ b/strings/strcoll.ic @@ -202,25 +202,40 @@ MY_FUNCTION_NAME(strnncoll)(CHARSET_INFO *cs __attribute__((unused)), } +#ifdef DEFINE_STRNNCOLLSP_NOPAD + /** - Compare two strings according to the collation, with PAD SPACE handling. + Compare two strings according to the collation, with NO PAD handling. @param cs - the character set and collation @param a - the left string @param a_length - the length of the left string @param b - the right string @param b_length - the length of the right string - @param diff_if_only_endspace_difference - not used in the code. - TODO: this should be eventually removed (in 10.2?) @return - the comparison result */ +static int +MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length) +{ + return MY_FUNCTION_NAME(strnncoll)(cs, a, a_length, b, b_length, FALSE); +} +#else +/** + Compare two strings according to the collation, with PAD SPACE handling. + @param cs - the character set and collation + @param a - the left string + @param a_length - the length of the left string + @param b - the right string + @param b_length - the length of the right string + @return - the comparison result +*/ static int MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)), const uchar *a, size_t a_length, - const uchar *b, size_t b_length, - my_bool diff_if_only_endspace_difference - __attribute__((unused))) + const uchar *b, size_t b_length) { const uchar *a_end= a + a_length; const uchar *b_end= b + b_length; @@ -261,6 +276,51 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)), DBUG_ASSERT(0); return 0; } +#endif + + +#ifdef DEFINE_STRNXFRM +#ifndef WEIGHT_MB2_FRM +#define WEIGHT_MB2_FRM(x,y) WEIGHT_MB2(x,y) +#endif + +static size_t +MY_FUNCTION_NAME(strnxfrm)(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + uchar *de= dst + dstlen; + const uchar *se= src + srclen; + const uchar *sort_order= cs->sort_order; + + for (; dst < de && src < se && nweights; nweights--) + { + if (my_charlen(cs, (const char *) src, (const char *) se) > 1) + { + /* + Note, it is safe not to check (src < se) + in the code below, because my_charlen() would + not return 2 if src was too short + */ + uint16 e= WEIGHT_MB2_FRM(src[0], src[1]); + *dst++= (uchar) (e >> 8); + if (dst < de) + *dst++= (uchar) (e & 0xFF); + src+= 2; + } + else + *dst++= sort_order ? sort_order[*src++] : *src++; + } +#ifdef DEFINE_STRNNCOLLSP_NOPAD + return my_strxfrm_pad_desc_and_reverse_nopad(cs, d0, dst, de, + nweights, flags, 0); +#else + return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); +#endif +} +#endif /* DEFINE_STRNXFRM */ + /* We usually include this file at least two times from the same source file, @@ -273,3 +333,6 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)), #undef WEIGHT_MB3 #undef WEIGHT_MB4 #undef WEIGHT_PAD_SPACE +#undef WEIGHT_MB2_FRM +#undef DEFINE_STRNXFRM +#undef DEFINE_STRNNCOLLSP_NOPAD diff --git a/strings/string.doc b/strings/string.doc index fcd020b8c60..3e5b607347a 100644 --- a/strings/string.doc +++ b/strings/string.doc @@ -41,7 +41,7 @@ Speciella användbara nya string-rutiner: backwards from pos from. pat is not a regex(3) pattern, it is a literal string which must be matched exactly. The result 0 if the pattern was not found else it is the start char of - the pattern counted from the begining of the string. + the pattern counted from the beginning of the string. strappend(dest, len, fill) appends fill-characters to a string so that the result length == len. If the string is longer than len it's diff --git a/strings/strings_def.h b/strings/strings_def.h index e137c796045..34a04458024 100644 --- a/strings/strings_def.h +++ b/strings/strings_def.h @@ -32,6 +32,8 @@ #define DBUG_ASSERT(A) assert(A) #endif +#define MY_NOPAD_ID(x) ((x)+0x400) + /* SPACE_INT is a word that contains only spaces */ #if SIZEOF_INT == 4 #define SPACE_INT 0x20202020 @@ -101,6 +103,11 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) return (end); } + +uint my_8bit_charset_flags_from_data(CHARSET_INFO *cs); +uint my_8bit_collation_flags_from_data(CHARSET_INFO *cs); + + /* Macros for hashing characters */ #define MY_HASH_ADD(A, B, value) \ |