16 #include <my_global.h>
51 #define my_snprintf "We cannot use my_snprintf in this file"
54 int (*my_string_stack_guard)(int)= NULL;
56 static char *mstr(
char *str,
const char *src,
size_t l1,
size_t l2)
78 #define _CS_COLLATION 9
79 #define _CS_UPPERMAP 10
80 #define _CS_LOWERMAP 11
82 #define _CS_COLLMAP 13
83 #define _CS_CTYPEMAP 14
84 #define _CS_PRIMARY_ID 15
85 #define _CS_BINARY_ID 16
86 #define _CS_CSDESCRIPT 17
90 #define _CS_UCA_VERSION 100
91 #define _CS_CL_SUPPRESS_CONTRACTIONS 101
92 #define _CS_CL_OPTIMIZE 102
93 #define _CS_CL_SHIFT_AFTER_METHOD 103
97 #define _CS_ST_SETTINGS 200
98 #define _CS_ST_STRENGTH 201
99 #define _CS_ST_ALTERNATE 202
100 #define _CS_ST_BACKWARDS 203
101 #define _CS_ST_NORMALIZATION 204
102 #define _CS_ST_CASE_LEVEL 205
103 #define _CS_ST_CASE_FIRST 206
104 #define _CS_ST_HIRAGANA_QUATERNARY 207
105 #define _CS_ST_NUMERIC 208
106 #define _CS_ST_VARIABLE_TOP 209
107 #define _CS_ST_MATCH_BOUNDARIES 210
108 #define _CS_ST_MATCH_STYLE 211
112 #define _CS_RULES 300
113 #define _CS_RESET 301
114 #define _CS_DIFF1 302
115 #define _CS_DIFF2 303
116 #define _CS_DIFF3 304
117 #define _CS_DIFF4 305
118 #define _CS_IDENTICAL 306
121 #define _CS_EXP_X 320
122 #define _CS_EXP_EXTEND 321
123 #define _CS_EXP_DIFF1 322
124 #define _CS_EXP_DIFF2 323
125 #define _CS_EXP_DIFF3 324
126 #define _CS_EXP_DIFF4 325
127 #define _CS_EXP_IDENTICAL 326
130 #define _CS_A_DIFF1 351
131 #define _CS_A_DIFF2 352
132 #define _CS_A_DIFF3 353
133 #define _CS_A_DIFF4 354
134 #define _CS_A_IDENTICAL 355
137 #define _CS_CONTEXT 370
140 #define _CS_RESET_BEFORE 380
143 #define _CS_RESET_FIRST_PRIMARY_IGNORABLE 401
144 #define _CS_RESET_LAST_PRIMARY_IGNORABLE 402
145 #define _CS_RESET_FIRST_SECONDARY_IGNORABLE 403
146 #define _CS_RESET_LAST_SECONDARY_IGNORABLE 404
147 #define _CS_RESET_FIRST_TERTIARY_IGNORABLE 405
148 #define _CS_RESET_LAST_TERTIARY_IGNORABLE 406
149 #define _CS_RESET_FIRST_TRAILING 407
150 #define _CS_RESET_LAST_TRAILING 408
151 #define _CS_RESET_FIRST_VARIABLE 409
152 #define _CS_RESET_LAST_VARIABLE 410
153 #define _CS_RESET_FIRST_NON_IGNORABLE 411
154 #define _CS_RESET_LAST_NON_IGNORABLE 412
161 {_CS_MISC,
"xml/version"},
162 {_CS_MISC,
"xml/encoding"},
163 {_CS_MISC,
"charsets"},
164 {_CS_MISC,
"charsets/max-id"},
165 {_CS_MISC,
"charsets/copyright"},
166 {_CS_MISC,
"charsets/description"},
167 {_CS_CHARSET,
"charsets/charset"},
168 {_CS_PRIMARY_ID,
"charsets/charset/primary-id"},
169 {_CS_BINARY_ID,
"charsets/charset/binary-id"},
170 {_CS_CSNAME,
"charsets/charset/name"},
171 {_CS_FAMILY,
"charsets/charset/family"},
172 {_CS_CSDESCRIPT,
"charsets/charset/description"},
173 {_CS_MISC,
"charsets/charset/alias"},
174 {_CS_MISC,
"charsets/charset/ctype"},
175 {_CS_CTYPEMAP,
"charsets/charset/ctype/map"},
176 {_CS_MISC,
"charsets/charset/upper"},
177 {_CS_UPPERMAP,
"charsets/charset/upper/map"},
178 {_CS_MISC,
"charsets/charset/lower"},
179 {_CS_LOWERMAP,
"charsets/charset/lower/map"},
180 {_CS_MISC,
"charsets/charset/unicode"},
181 {_CS_UNIMAP,
"charsets/charset/unicode/map"},
182 {_CS_COLLATION,
"charsets/charset/collation"},
183 {_CS_COLNAME,
"charsets/charset/collation/name"},
184 {_CS_ID,
"charsets/charset/collation/id"},
185 {_CS_ORDER,
"charsets/charset/collation/order"},
186 {_CS_FLAG,
"charsets/charset/collation/flag"},
187 {_CS_COLLMAP,
"charsets/charset/collation/map"},
190 {_CS_UCA_VERSION,
"charsets/charset/collation/version"},
191 {_CS_CL_SUPPRESS_CONTRACTIONS,
"charsets/charset/collation/suppress_contractions"},
192 {_CS_CL_OPTIMIZE,
"charsets/charset/collation/optimize"},
193 {_CS_CL_SHIFT_AFTER_METHOD,
"charsets/charset/collation/shift-after-method"},
196 {_CS_ST_SETTINGS,
"charsets/charset/collation/settings"},
197 {_CS_ST_STRENGTH,
"charsets/charset/collation/settings/strength"},
198 {_CS_ST_ALTERNATE,
"charsets/charset/collation/settings/alternate"},
199 {_CS_ST_BACKWARDS,
"charsets/charset/collation/settings/backwards"},
200 {_CS_ST_NORMALIZATION,
"charsets/charset/collation/settings/normalization"},
201 {_CS_ST_CASE_LEVEL,
"charsets/charset/collation/settings/caseLevel"},
202 {_CS_ST_CASE_FIRST,
"charsets/charset/collation/settings/caseFirst"},
203 {_CS_ST_HIRAGANA_QUATERNARY,
"charsets/charset/collation/settings/hiraganaQuaternary"},
204 {_CS_ST_NUMERIC,
"charsets/charset/collation/settings/numeric"},
205 {_CS_ST_VARIABLE_TOP,
"charsets/charset/collation/settings/variableTop"},
206 {_CS_ST_MATCH_BOUNDARIES,
"charsets/charset/collation/settings/match-boundaries"},
207 {_CS_ST_MATCH_STYLE,
"charsets/charset/collation/settings/match-style"},
210 {_CS_RULES,
"charsets/charset/collation/rules"},
211 {_CS_RESET,
"charsets/charset/collation/rules/reset"},
212 {_CS_DIFF1,
"charsets/charset/collation/rules/p"},
213 {_CS_DIFF2,
"charsets/charset/collation/rules/s"},
214 {_CS_DIFF3,
"charsets/charset/collation/rules/t"},
215 {_CS_DIFF4,
"charsets/charset/collation/rules/q"},
216 {_CS_IDENTICAL,
"charsets/charset/collation/rules/i"},
219 {_CS_EXP_X,
"charsets/charset/collation/rules/x"},
220 {_CS_EXP_EXTEND,
"charsets/charset/collation/rules/x/extend"},
221 {_CS_EXP_DIFF1,
"charsets/charset/collation/rules/x/p"},
222 {_CS_EXP_DIFF2,
"charsets/charset/collation/rules/x/s"},
223 {_CS_EXP_DIFF3,
"charsets/charset/collation/rules/x/t"},
224 {_CS_EXP_DIFF4,
"charsets/charset/collation/rules/x/q"},
225 {_CS_EXP_IDENTICAL,
"charsets/charset/collation/rules/x/i"},
228 {_CS_CONTEXT,
"charsets/charset/collation/rules/x/context"},
231 {_CS_A_DIFF1,
"charsets/charset/collation/rules/pc"},
232 {_CS_A_DIFF2,
"charsets/charset/collation/rules/sc"},
233 {_CS_A_DIFF3,
"charsets/charset/collation/rules/tc"},
234 {_CS_A_DIFF4,
"charsets/charset/collation/rules/qc"},
235 {_CS_A_IDENTICAL,
"charsets/charset/collation/rules/ic"},
238 {_CS_RESET_BEFORE,
"charsets/charset/collation/rules/reset/before"},
241 {_CS_RESET_FIRST_NON_IGNORABLE,
"charsets/charset/collation/rules/reset/first_non_ignorable"},
242 {_CS_RESET_LAST_NON_IGNORABLE,
"charsets/charset/collation/rules/reset/last_non_ignorable"},
243 {_CS_RESET_FIRST_PRIMARY_IGNORABLE,
"charsets/charset/collation/rules/reset/first_primary_ignorable"},
244 {_CS_RESET_LAST_PRIMARY_IGNORABLE,
"charsets/charset/collation/rules/reset/last_primary_ignorable"},
245 {_CS_RESET_FIRST_SECONDARY_IGNORABLE,
"charsets/charset/collation/rules/reset/first_secondary_ignorable"},
246 {_CS_RESET_LAST_SECONDARY_IGNORABLE,
"charsets/charset/collation/rules/reset/last_secondary_ignorable"},
247 {_CS_RESET_FIRST_TERTIARY_IGNORABLE,
"charsets/charset/collation/rules/reset/first_tertiary_ignorable"},
248 {_CS_RESET_LAST_TERTIARY_IGNORABLE,
"charsets/charset/collation/rules/reset/last_tertiary_ignorable"},
249 {_CS_RESET_FIRST_TRAILING,
"charsets/charset/collation/rules/reset/first_trailing"},
250 {_CS_RESET_LAST_TRAILING,
"charsets/charset/collation/rules/reset/last_trailing"},
251 {_CS_RESET_FIRST_VARIABLE,
"charsets/charset/collation/rules/reset/first_variable"},
252 {_CS_RESET_LAST_VARIABLE,
"charsets/charset/collation/rules/reset/last_variable"},
260 for (s= sec; s->str; s++)
262 if (!strncmp(attr, s->str, len) && s->str[len] == 0)
268 #define MY_CS_CSDESCR_SIZE 64
269 #define MY_CS_TAILORING_SIZE 32*1024
270 #define MY_CS_UCA_VERSION_SIZE 64
271 #define MY_CS_CONTEXT_SIZE 64
275 char csname[MY_CS_NAME_SIZE];
276 char name[MY_CS_NAME_SIZE];
277 uchar ctype[MY_CS_CTYPE_TABLE_SIZE];
278 uchar to_lower[MY_CS_TO_LOWER_TABLE_SIZE];
279 uchar to_upper[MY_CS_TO_UPPER_TABLE_SIZE];
280 uchar sort_order[MY_CS_SORT_ORDER_TABLE_SIZE];
281 uint16 tab_to_uni[MY_CS_TO_UNI_TABLE_SIZE];
282 char comment[MY_CS_CSDESCR_SIZE];
284 size_t tailoring_length;
285 size_t tailoring_alloced_length;
286 char context[MY_CS_CONTEXT_SIZE];
295 memset(&i->cs, 0,
sizeof(i->cs));
302 i->tailoring_length= 0;
310 my_charset_file_reset_charset(i);
311 my_charset_file_reset_collation(i);
313 i->tailoring_alloced_length= 0;
320 i->loader->free(i->tailoring);
327 if (i->tailoring_alloced_length > newlen ||
328 (i->tailoring= i->loader->realloc(i->tailoring,
329 (i->tailoring_alloced_length=
330 (newlen + 32*1024)))))
338 static int fill_uchar(uchar *a,uint
size,
const char *str,
size_t len)
341 const char *s, *b, *e=str+len;
343 for (s=str ; s < e ; i++)
345 for ( ; (s < e) && strchr(
" \t\r\n",s[0]); s++) ;
347 for ( ; (s < e) && !strchr(
" \t\r\n",s[0]); s++) ;
348 if (s == b || i > size)
350 a[
i]= (uchar) strtoul(b,NULL,16);
355 static int fill_uint16(uint16 *a,uint size,
const char *str,
size_t len)
359 const char *s, *b, *e=str+len;
360 for (s=str ; s < e ; i++)
362 for ( ; (s < e) && strchr(
" \t\r\n",s[0]); s++) ;
364 for ( ; (s < e) && !strchr(
" \t\r\n",s[0]); s++) ;
365 if (s == b || i > size)
367 a[
i]= (uint16) strtol(b,NULL,16);
377 const char *
fmt,
size_t len,
const char *attr)
380 size_t newlen= i->tailoring_length + len + 64;
381 if (MY_XML_OK == my_charset_file_tailoring_realloc(i, newlen))
383 char *dst= i->tailoring + i->tailoring_length;
384 sprintf(dst, fmt, (
int) len, attr);
385 i->tailoring_length+= strlen(dst);
395 size_t len1,
const char *attr1,
396 size_t len2,
const char *attr2)
399 size_t newlen= i->tailoring_length + len1 + len2 + 64;
400 if (MY_XML_OK == my_charset_file_tailoring_realloc(i, newlen))
402 char *dst= i->tailoring + i->tailoring_length;
403 sprintf(dst, fmt, (
int) len1, attr1, (
int) len2, attr2);
404 i->tailoring_length+= strlen(dst);
412 scan_one_character(
const char *s,
const char *e, my_wc_t *wc)
419 if (s[0] ==
'\\' && s + 2 < e && s[1] ==
'u' && my_isxdigit(cs, s[2]))
422 for (s+= 3; s < e && my_isxdigit(cs, s[0]); s++, len++)
435 int rc= cs->cset->mb_wc(cs, wc, (uchar *) s, (uchar *) e);
445 const char *fmt,
size_t len,
const char *attr)
448 const char *attrend= attr + len;
451 for ( ; (clen= scan_one_character(attr, attrend, &wc)) > 0; attr+= clen)
453 DBUG_ASSERT(attr < attrend);
454 if (tailoring_append(st, fmt, clen, attr) != MY_XML_OK)
461 static int cs_enter(
MY_XML_PARSER *st,
const char *attr,
size_t len)
465 int state= s ? s->state : 0;
469 i->loader->reporter(WARNING_LEVEL,
"Unknown LDML tag: '%.*s'", len, attr);
473 my_charset_file_reset_charset(i);
477 my_charset_file_reset_collation(i);
481 return tailoring_append(st,
" &", 0, NULL);
490 static int cs_leave(
MY_XML_PARSER *st,
const char *attr,
size_t len)
494 int state= s ? s->state : 0;
499 if (i->tailoring_length)
500 i->cs.tailoring= i->tailoring;
501 rc= i->loader->add_collation ? i->loader->add_collation(&i->cs) : MY_XML_OK;
505 case _CS_RESET_FIRST_NON_IGNORABLE:
506 rc= tailoring_append(st,
"[first non-ignorable]", 0, NULL);
509 case _CS_RESET_LAST_NON_IGNORABLE:
510 rc= tailoring_append(st,
"[last non-ignorable]", 0, NULL);
513 case _CS_RESET_FIRST_PRIMARY_IGNORABLE:
514 rc= tailoring_append(st,
"[first primary ignorable]", 0, NULL);
517 case _CS_RESET_LAST_PRIMARY_IGNORABLE:
518 rc= tailoring_append(st,
"[last primary ignorable]", 0, NULL);
521 case _CS_RESET_FIRST_SECONDARY_IGNORABLE:
522 rc= tailoring_append(st,
"[first secondary ignorable]", 0, NULL);
525 case _CS_RESET_LAST_SECONDARY_IGNORABLE:
526 rc= tailoring_append(st,
"[last secondary ignorable]", 0, NULL);
529 case _CS_RESET_FIRST_TERTIARY_IGNORABLE:
530 rc= tailoring_append(st,
"[first tertiary ignorable]", 0, NULL);
533 case _CS_RESET_LAST_TERTIARY_IGNORABLE:
534 rc= tailoring_append(st,
"[last tertiary ignorable]", 0, NULL);
537 case _CS_RESET_FIRST_TRAILING:
538 rc= tailoring_append(st,
"[first trailing]", 0, NULL);
541 case _CS_RESET_LAST_TRAILING:
542 rc= tailoring_append(st,
"[last trailing]", 0, NULL);
545 case _CS_RESET_FIRST_VARIABLE:
546 rc= tailoring_append(st,
"[first variable]", 0, NULL);
549 case _CS_RESET_LAST_VARIABLE:
550 rc= tailoring_append(st,
"[last variable]", 0, NULL);
560 static const char *diff_fmt[5]=
570 static const char *context_diff_fmt[5]=
580 static int cs_value(
MY_XML_PARSER *st,
const char *attr,
size_t len)
584 int state= (
int)((s= cs_file_sec(st->attr.start,
585 st->attr.end - st->attr.start)) ?
595 i->cs.number= strtol(attr,(
char**)NULL,10);
598 i->cs.binary_number= strtol(attr,(
char**)NULL,10);
601 i->cs.primary_number= strtol(attr,(
char**)NULL,10);
604 i->cs.name=mstr(i->name,attr,len,MY_CS_NAME_SIZE-1);
607 i->cs.csname=mstr(i->csname,attr,len,MY_CS_NAME_SIZE-1);
610 i->cs.comment=mstr(i->comment,attr,len,MY_CS_CSDESCR_SIZE-1);
613 if (!strncmp(
"primary",attr,len))
614 i->cs.state|= MY_CS_PRIMARY;
615 else if (!strncmp(
"binary",attr,len))
616 i->cs.state|= MY_CS_BINSORT;
617 else if (!strncmp(
"compiled",attr,len))
618 i->cs.state|= MY_CS_COMPILED;
621 fill_uchar(i->to_upper,MY_CS_TO_UPPER_TABLE_SIZE,attr,len);
622 i->cs.to_upper=i->to_upper;
625 fill_uchar(i->to_lower,MY_CS_TO_LOWER_TABLE_SIZE,attr,len);
626 i->cs.to_lower=i->to_lower;
629 fill_uint16(i->tab_to_uni,MY_CS_TO_UNI_TABLE_SIZE,attr,len);
630 i->cs.tab_to_uni=i->tab_to_uni;
633 fill_uchar(i->sort_order,MY_CS_SORT_ORDER_TABLE_SIZE,attr,len);
634 i->cs.sort_order=i->sort_order;
637 fill_uchar(i->ctype,MY_CS_CTYPE_TABLE_SIZE,attr,len);
638 i->cs.ctype=i->ctype;
642 case _CS_UCA_VERSION:
643 rc= tailoring_append(st,
"[version %.*s]", len, attr);
646 case _CS_CL_SUPPRESS_CONTRACTIONS:
647 rc= tailoring_append(st,
"[suppress contractions %.*s]", len, attr);
650 case _CS_CL_OPTIMIZE:
651 rc= tailoring_append(st,
"[optimize %.*s]", len, attr);
654 case _CS_CL_SHIFT_AFTER_METHOD:
655 rc= tailoring_append(st,
"[shift-after-method %.*s]", len, attr);
659 case _CS_ST_STRENGTH:
661 rc= tailoring_append(st,
"[strength %.*s]", len, attr);
664 case _CS_ST_ALTERNATE:
666 rc= tailoring_append(st,
"[alternate %.*s]", len, attr);
669 case _CS_ST_BACKWARDS:
671 rc= tailoring_append(st,
"[backwards %.*s]", len, attr);
674 case _CS_ST_NORMALIZATION:
680 rc= tailoring_append(st,
"[normalization %.*s]", len, attr);
683 case _CS_ST_CASE_LEVEL:
685 rc= tailoring_append(st,
"[caseLevel %.*s]", len, attr);
688 case _CS_ST_CASE_FIRST:
690 rc= tailoring_append(st,
"[caseFirst %.*s]", len, attr);
693 case _CS_ST_HIRAGANA_QUATERNARY:
695 rc= tailoring_append(st,
"[hiraganaQ %.*s]", len, attr);
700 rc= tailoring_append(st,
"[numeric %.*s]", len, attr);
703 case _CS_ST_VARIABLE_TOP:
705 rc= tailoring_append(st,
"[variableTop %.*s]", len, attr);
708 case _CS_ST_MATCH_BOUNDARIES:
710 rc= tailoring_append(st,
"[match-boundaries %.*s]", len, attr);
713 case _CS_ST_MATCH_STYLE:
715 rc= tailoring_append(st,
"[match-style %.*s]", len, attr);
721 rc= tailoring_append(st,
"%.*s", len, attr);
729 rc= tailoring_append(st, diff_fmt[state - _CS_DIFF1], len, attr);
735 rc= tailoring_append(st,
" / %.*s", len, attr);
742 case _CS_EXP_IDENTICAL:
745 rc= tailoring_append2(st, context_diff_fmt[state - _CS_EXP_DIFF1],
746 strlen(i->context), i->context, len, attr);
750 rc= tailoring_append(st, diff_fmt[state - _CS_EXP_DIFF1], len, attr);
755 if (len <
sizeof(i->context) + 1)
757 memcpy(i->context, attr, len);
758 i->context[len]=
'\0';
767 case _CS_A_IDENTICAL:
768 rc= tailoring_append_abbreviation(st, diff_fmt[state - _CS_A_DIFF1], len, attr);
772 case _CS_RESET_BEFORE:
778 rc= tailoring_append(st,
"[before %.*s]", len, attr);
797 my_charset_file_init(&info);
798 my_xml_parser_create(&p);
799 my_xml_set_enter_handler(&p,cs_enter);
800 my_xml_set_value_handler(&p,cs_value);
801 my_xml_set_leave_handler(&p,cs_leave);
803 my_xml_set_user_data(&p, (
void *) &info);
804 rc= (my_xml_parse(&p,buf,len) == MY_XML_OK) ? FALSE : TRUE;
805 my_xml_parser_free(&p);
806 my_charset_file_free(&info);
809 const char *errstr= my_xml_error_string(&p);
810 if (
sizeof(loader->error) > 32 + strlen(errstr))
813 sprintf(loader->error,
"at line %d pos %d: %s",
814 my_xml_error_lineno(&p)+1,
815 (
int) my_xml_error_pos(&p),
816 my_xml_error_string(&p));
827 my_string_repertoire(
const CHARSET_INFO *cs,
const char *str, ulong length)
829 const char *strend= str + length;
830 if (cs->mbminlen == 1)
832 for ( ; str < strend; str++)
834 if (((uchar) *str) > 0x7F)
835 return MY_REPERTOIRE_UNICODE30;
843 (chlen= cs->cset->mb_wc(cs, &wc, (uchar*) str, (uchar*) strend)) > 0;
847 return MY_REPERTOIRE_UNICODE30;
850 return MY_REPERTOIRE_ASCII;
859 return cs->state & MY_CS_PUREASCII ?
860 MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
894 (cs->mbmaxlen == 1 && cs->tab_to_uni && cs->tab_to_uni[
'{'] ==
'{') ||
895 (cs->mbminlen == 1 && cs->mbmaxlen > 1);
912 for (code= 0; code < 256; code++)
914 if (cs->tab_to_uni[code] > 0x7F)
932 for (i= 0; i < 128; i++)
934 if (cs->tab_to_uni[i] != i)
957 my_convert_internal(
char *
to, uint32 to_length,
959 const char *from, uint32 from_length,
964 const uchar *from_end= (
const uchar*) from + from_length;
966 uchar *to_end= (uchar*) to + to_length;
967 my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
968 my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
973 if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from, from_end)) > 0)
975 else if (cnvres == MY_CS_ILSEQ)
981 else if (cnvres > MY_CS_TOOSMALL)
995 if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
997 else if (cnvres == MY_CS_ILUNI && wc !=
'?')
1006 *errors= error_count;
1007 return (uint32) (to - to_start);
1028 my_convert(
char *to, uint32 to_length,
const CHARSET_INFO *to_cs,
1029 const char *from, uint32 from_length,
1032 uint32 length, length2;
1037 if ((to_cs->state | from_cs->state) & MY_CS_NONASCII)
1038 return my_convert_internal(to, to_length, to_cs,
1039 from, from_length, from_cs, errors);
1041 length= length2= MY_MIN(to_length, from_length);
1043 #if defined(__i386__)
1051 for ( ; length >= 4; length-= 4, from+= 4, to+= 4)
1053 if ((*(uint32*)from) & 0x80808080)
1055 *((uint32*) to)= *((
const uint32*) from);
1059 for (; ; *to++= *from++, length--)
1066 if (*((
unsigned char*) from) > 0x7F)
1068 uint32 copied_length= length2 - length;
1069 to_length-= copied_length;
1070 from_length-= copied_length;
1071 return copied_length + my_convert_internal(to, to_length, to_cs,
1072 from, from_length, from_cs,