42 #if defined (SUPPRESS_STRLEN_WARNING) 43 #define strlen(s1) ((int) strlen(s1)) 46 #define IS_8BIT(c) ((c) >> 7) 54 #define LOCALE_KOREAN "ko_KR.IBM-eucKR" 56 #define LOCALE_KOREAN "korean" 59 #if defined (ENABLE_UNUSED_FUNCTION) 64 #define IS_PSEUDO_KOREAN(ch) \ 65 ( ((unsigned char) ch >= (unsigned char) 0xa1) \ 66 && ((unsigned char) ch <= (unsigned char) 0xfe) ) 69 #define CHAR_BYTE_TO_LOWER(c) ((c) + ('a' - 'A')) 71 #define CHAR_BYTE_TO_UPPER(c) ((c) - ('a' - 'A')) 74 #define ISO_8859_9_FIRST_CP 0x11e 75 #define ISO_8859_9_LAST_CP 0x15f 90 static int intl_tolower_euc (
const unsigned char *src,
unsigned char *d,
int byte_size);
91 static int intl_toupper_euc (
const unsigned char *src,
unsigned char *d,
int byte_size);
94 #if defined (ENABLE_UNUSED_FUNCTION) 95 static wchar_t *intl_copy_lowercase (
const wchar_t * ws,
size_t n);
96 static int intl_is_korean (
unsigned char ch);
106 unsigned char **next);
108 unsigned char **next);
110 const int size_str1,
const int size_str2,
unsigned int cp1,
unsigned int cp2,
111 int *skip_size1,
int *skip_size2);
158 return (
char *) (strchr (mbs, (
int) wc));
161 for (nbytes = 0; (nbytes = mbtowc (&cur_wc, mbs,
MB_LEN_MAX)) > 0 && cur_wc != L
'\0' && cur_wc != wc; mbs += nbytes)
195 for (num_of_chars = 0; (clen = mblen (mbs,
MB_LEN_MAX)) > 0 && *mbs; mbs += clen, num_of_chars++)
232 if (
strlen (mbs) < (
int) n)
240 for (num_of_chars = 0, clen = 0; num_of_chars < n && (clen = mblen (mbs, MB_LEN_MAX)) > 0 && *mbs;
241 mbs += clen, num_of_chars++)
251 else if (num_of_chars < n)
279 return (
int) strspn (mbs, (
const char *) chars);
282 for (size = 0; (clen = mbtowc (&wc, mbs,
MB_LEN_MAX)) > 0 && *mbs && wcschr (chars, wc); mbs += clen, size += clen)
296 #if defined (ENABLE_UNUSED_FUNCTION) 310 intl_mbs_namecmp (
const char *mbs1,
const char *mbs2)
312 const char *cp1 = mbs1;
313 const char *cp2 = mbs2;
314 int cp1_len, cp2_len;
333 if (cp1_len != cp2_len)
361 int mb1_len, mb2_len;
368 return _stricmp (mbs1, mbs2);
370 return strcasecmp (mbs1, mbs2);
375 mb1_len > 0 && mb2_len > 0 && wc1 && wc2 && !(towlower (wc1) - towlower (wc2));)
384 if (mb1_len < 0 || mb2_len < 0)
389 return (
int) (towlower (wc1) - towlower (wc2));
392 #if defined (ENABLE_UNUSED_FUNCTION) 394 intl_mbs_cmp (
const char *mbs1,
const char *mbs2)
397 int mb1_len, mb2_len;
403 return strcmp (mbs1, mbs2);
407 mb1_len > 0 && mb2_len > 0 && wc1 && wc2 && !(wc1 - wc2);)
416 if (mb1_len < 0 || mb2_len < 0)
421 return (
int) (wc1 - wc2);
444 int mb1_len, mb2_len;
452 return _strnicmp (mbs1, mbs2, n);
454 return strncasecmp (mbs1, mbs2, n);
458 for (num_of_chars = 1, mb1_len = mbtowc (&wc1, mbs1,
MB_LEN_MAX), mb2_len = mbtowc (&wc2, mbs2,
MB_LEN_MAX);
459 mb1_len > 0 && mb2_len > 0 && wc1 && wc2 && num_of_chars < n && !(towlower (wc1) - towlower (wc2));
469 if (mb1_len < 0 || mb2_len < 0)
474 return (
int) (towlower (wc1) - towlower (wc2));
499 size_t src_len =
strlen (mbs2);
501 strncpy (mbs1, mbs2, n - 1);
504 mbs1[src_len] =
'\0';
514 for (num_of_bytes = 0, clen = mblen (mbs2,
MB_LEN_MAX), dest = mbs1; clen > 0 && (num_of_bytes + clen) <= n - 1;
518 for (i = 0; i < clen; i++)
524 num_of_bytes += clen;
540 #if defined (ENABLE_UNUSED_FUNCTION) 548 intl_mbs_lower (
const char *mbs1,
char *mbs2)
551 int length_in_bytes = 0;
556 s = strcpy (mbs2, mbs1);
567 length_in_bytes =
strlen (mbs1);
574 mbs2[length_in_bytes] =
'\0';
593 intl_mbs_nlower (
char *dest,
const char *src,
const int max_len)
596 int length_in_bytes = 0;
607 for (i = 0; (src[
i] !=
'\0') && (i < max_len - 1); ++
i)
615 length_in_bytes =
strlen (src);
617 if (length_in_bytes >= max_len)
620 length_in_bytes = max_len - 1;
623 if (length_in_bytes > 0)
627 dest[length_in_bytes] =
'\0';
644 intl_mbs_upper (
const char *mbs1,
char *mbs2)
647 int length_in_bytes = 0;
653 for (s = strcpy (mbs2, mbs1); *s; s++)
662 length_in_bytes =
strlen (mbs1);
669 mbs2[length_in_bytes] =
'\0';
690 intl_copy_lowercase (
const wchar_t * ws,
size_t n)
695 lower_ws = (
wchar_t *) malloc (
sizeof (
wchar_t) * (n + 1));
698 for (i = 0; ws[
i] && i < n; i++)
700 lower_ws[
i] = towlower (ws[i]);
723 int char_count = length;
728 for (end = s + length; s < end; s++)
749 int char_count = length;
754 for (end = s + length; s < end; s++)
776 const unsigned char *
783 *curr_char_length = 1;
787 *curr_char_length = 3;
791 *curr_char_length = 2;
794 return (s + (*curr_char_length));
805 const unsigned char *
811 if (s - 3 >= s_start && *(s - 3) ==
SS3)
813 *prev_char_length = 3;
816 else if (s - 2 >= s_start &&
IS_8BIT (*(s - 2)))
818 *prev_char_length = 2;
822 *prev_char_length = 1;
837 const unsigned char *s = src;
841 for (byte_count = 0; byte_count < byte_size; byte_count++)
862 const unsigned char *s = src;
866 for (byte_count = 0; byte_count < byte_size; byte_count++)
892 const unsigned char *end;
898 for (end = s + length_in_bytes, char_count = 0; s < end;)
927 for (char_count = 0, byte_count = 0; char_count < length_in_chars; char_count++)
930 byte_count += char_width;
989 *char_count = length_in_bytes;
1024 switch (src_codeset)
1028 *byte_count = length_in_chars;
1048 #if defined (ENABLE_UNUSED_FUNCTION) 1066 intl_char_size_pseudo_kor (
const unsigned char *src,
int length_in_chars,
INTL_CODESET src_codeset,
int *byte_count)
1068 switch (src_codeset)
1074 while (length_in_chars-- > 0)
1081 else if (IS_PSEUDO_KOREAN (*src))
1092 *byte_count = b_count;
1096 *byte_count = length_in_chars;
1127 const unsigned char *
1147 *prev_char_size = 1;
1151 #if defined (ENABLE_UNUSED_FUNCTION) 1167 intl_prev_char_pseudo_kor (
const unsigned char *s,
const unsigned char *s_start,
INTL_CODESET codeset,
1168 int *prev_char_size)
1177 if (s - 2 >= s_start && *(s - 2) ==
SS3)
1179 *prev_char_size = 3;
1182 else if (s - 1 >= s_start && IS_PSEUDO_KOREAN (*(s - 1)))
1184 *prev_char_size = 2;
1201 *prev_char_size = 1;
1217 const unsigned char *
1224 *current_char_size = 1;
1235 *current_char_size = 0;
1240 #if defined (ENABLE_UNUSED_FUNCTION) 1255 intl_next_char_pseudo_kor (
const unsigned char *s,
INTL_CODESET codeset,
int *current_char_size)
1264 *current_char_size = 3;
1267 else if (IS_PSEUDO_KOREAN (*s))
1269 *current_char_size = 2;
1274 *current_char_size = 1;
1285 *current_char_size = 0;
1316 return memcmp (s1, s2, *char_size);
1320 return memcmp (s1, s2, *char_size);
1331 #if defined (ENABLE_UNUSED_FUNCTION) 1345 intl_cmp_char_pseudo_kor (
const unsigned char *s1,
const unsigned char *s2,
INTL_CODESET codeset,
int *char_size)
1355 return memcmp (s1, s2, 3);
1357 else if (IS_PSEUDO_KOREAN (*s1))
1360 return memcmp (s1, s2, 2);
1368 return memcmp (s1, s2, *char_size);
1372 return memcmp (s1, s2, *char_size);
1394 intl_kor_cmp (
unsigned char *s1,
unsigned char *s2,
int size)
1399 if (!
prm_get_bool_value (PRM_ID_SINGLE_BYTE_COMPARE) && IS_PSEUDO_KOREAN (*s1) && IS_PSEUDO_KOREAN (*s2))
1401 r = memcmp (s1, s2, 2);
1413 else if ((
prm_get_bool_value (PRM_ID_SINGLE_BYTE_COMPARE) || !IS_PSEUDO_KOREAN (*s1)) && *s1 == *s2)
1455 pad_char[0] = pad_char[1] =
'\241';
1519 int req_size = src_size;
1535 unsigned char *next =
NULL;
1538 for (char_count = 0; char_count < src_length && src_size > 0; char_count++)
1574 memcpy (dst, src, length_in_chars);
1575 char_count = length_in_chars;
1581 const unsigned char *s;
1583 for (d = dst, s = src; d < dst + length_in_chars; d++, s++)
1587 char_count = length_in_chars;
1605 char_count =
intl_toupper_utf8 (alphabet, src, dst, length_in_chars, &dummy_size);
1630 int req_size = src_size;
1646 unsigned char *next;
1649 for (char_count = 0; char_count < src_length && src_size > 0; char_count++)
1687 const unsigned char *s;
1689 for (d = dst, s = src; d < dst + length_in_chars; d++, s++)
1693 char_count = length_in_chars;
1698 memcpy (dst, src, length_in_chars);
1715 char_count =
intl_tolower_utf8 (alphabet, src, dst, length_in_chars, &dummy_size);
1727 #if defined (ENABLE_UNUSED_FUNCTION) 1735 intl_is_korean (
unsigned char ch)
1741 return (ch >= 0xb0 && ch <= 0xc8) || (ch >= 0xa1 && ch <= 0xfe);
1751 intl_language (
int category)
1753 char *loc = setlocale (category,
NULL);
1755 #if defined(WINDOWS) || defined(SOLARIS) 1805 const unsigned char *end, *s;
1819 d = dst + length_in_chars - 1;
1820 end = src + length_in_chars;
1821 for (; s < end; char_count++)
1831 d = dst + size_in_bytes - 1;
1832 end = src + size_in_bytes;
1833 for (; s < end && char_count < length_in_chars; char_count++)
1842 *(d - 1) = *(s + 1);
1860 d = dst + size_in_bytes - 1;
1861 end = src + size_in_bytes;
1862 for (; s < end && char_count < length_in_chars; char_count++)
1901 if ((*chr == 0xf4) && (*(chr + 1) == 0x8f) && (*(chr + 2) == 0xbf) && (*(chr + 3) == 0xbf))
1907 if (((*chr == 0xff) && (*(chr + 1) == 0xff)))
1988 *(chr + 1) = (
char) 0x8f;
1989 *(chr + 2) = (
char) 0xbf;
1990 *(chr + 3) = (
char) 0xbf;
1994 *(chr + 1) = (
char) 0xff;
2011 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2012 1, 1, 1, 1, 1, 1, 1,
2013 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2014 1, 1, 1, 1, 1, 1, 1,
2015 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2016 1, 1, 1, 1, 1, 1, 1,
2017 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2018 1, 1, 1, 1, 1, 1, 1,
2019 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2020 1, 1, 1, 1, 1, 1, 1,
2021 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2022 1, 1, 1, 1, 1, 1, 1,
2023 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2024 2, 2, 2, 2, 2, 2, 2,
2025 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
2038 const unsigned char *
2053 const unsigned char *
2062 while (l < 6 && s - l >= s_start && (*(s - l) & 0xc0) == 0x80);
2064 l = (*(s - l) & 0xc0) == 0x80 ? 1 : l;
2066 *prev_char_length = l;
2085 int char_count, size;
2087 unsigned char *next =
NULL;
2095 for (char_count = 0; char_count < length_in_chars; char_count++)
2126 int char_count, size;
2128 unsigned char *next =
NULL;
2136 for (char_count = 0; char_count < length_in_chars; char_count++)
2169 const unsigned char *end;
2175 for (end = s + length_in_bytes, char_count = 0; s < end;)
2204 for (char_count = 0, byte_count = 0; char_count < length_in_chars; char_count++)
2207 byte_count += char_width;
2227 unsigned char **next)
2233 if (cp < (
unsigned int) (alphabet->
l_count))
2237 unsigned int lower_cp = alphabet->
lower_cp[cp];
2243 const unsigned int *case_p;
2246 int total_bytes = 0;
2256 total_bytes += bytes;
2260 while (count < alphabet->lower_multiplier && *case_p != 0);
2265 else if (cp == 0xffffffff)
2289 unsigned char **next)
2295 if (cp < (
unsigned int) (alphabet->
l_count))
2299 unsigned upper_cp = alphabet->
upper_cp[cp];
2305 const unsigned int *case_p;
2308 int total_bytes = 0;
2317 total_bytes += bytes;
2321 while (count < alphabet->upper_multiplier && *case_p != 0);
2326 else if (cp == 0xffffffff)
2347 const int size_str2)
2349 #if INTL_IDENTIFIER_CASING_SIZE_MULTIPLIER <= 1 2350 if (size_str1 != size_str2)
2352 return (size_str1 < size_str2) ? -1 : 1;
2360 unsigned char *str1_end, *str2_end;
2361 unsigned char *dummy;
2362 unsigned int cp1, cp2;
2370 str1_end = str1 + size_str1;
2371 str2_end = str2 + size_str2;
2373 for (; str1 < str1_end && str2 < str2_end;)
2375 int skip_size1 = 0, skip_size2 = 0;
2383 CAST_STRLEN (str2_end - str2), cp1, cp2, &skip_size1, &skip_size2);
2394 return (str1 < str1_end) ? 1 : ((str2 < str2_end) ? -1 : 0);
2400 unsigned char *str1_end, *str2_end;
2401 unsigned char lower1, lower2;
2403 if (size_str1 != size_str2)
2405 return (size_str1 < size_str2) ? -1 : 1;
2408 str1_end = str1 + size_str1;
2409 str2_end = str2 + size_str2;
2411 for (; str1 < str1_end && str2 < str2_end; str1++, str2++)
2417 if (lower1 != lower2)
2419 return (lower1 < lower2) ? -1 : 1;
2424 return (str1 < str1_end) ? 1 : ((str2 < str2_end) ? -1 : 0);
2429 if (size_str1 != size_str2)
2431 return (size_str1 < size_str2) ? -1 : 1;
2434 return strncasecmp ((
char *) str1, (
char *) str2, size_str1);
2456 const int size_tok,
const int size_src,
int *matched_size_src)
2466 *matched_size_src = 0;
2472 unsigned char *tok_end, *src_end;
2473 unsigned char *dummy;
2474 unsigned int cp1, cp2;
2482 tok_end = tok + size_tok;
2483 src_end = src + size_src;
2485 for (; tok < tok_end && src < src_end;)
2487 int skip_size_tok = 0, skip_size_src = 0;
2495 cp1, cp2, &skip_size_tok, &skip_size_src);
2502 tok += skip_size_tok;
2503 src += skip_size_src;
2504 *matched_size_src += skip_size_src;
2507 return (tok < tok_end) ? 1 : 0;
2513 unsigned char *tok_end, *src_end;
2514 unsigned char lower1, lower2;
2515 tok_end = tok + size_tok;
2516 src_end = src + size_src;
2518 if (size_tok > size_src)
2523 *matched_size_src = size_tok;
2524 for (; tok < tok_end && src < src_end; tok++, src++)
2530 if (lower1 != lower2)
2532 return (lower1 < lower2) ? -1 : 1;
2541 if (size_tok > size_src)
2546 *matched_size_src = size_tok;
2547 return strncasecmp ((
char *) tok, (
char *) src, size_tok);
2572 const int size_str1,
const int size_str2,
unsigned int cp1,
unsigned int cp2,
2573 int *skip_size1,
int *skip_size2)
2578 int skip_len1 = 1, skip_len2 = 1;
2579 int l_count_1 = 0, l_count_2 = 0, l_count = 0;
2581 bool use_original_str1, use_original_str2;
2583 unsigned int *casing_arr;
2584 int casing_multiplier;
2600 alpha_cnt = alphabet->
l_count;
2604 if (cp1 < (
unsigned int) alpha_cnt)
2609 if (cp2 < (
unsigned int) alpha_cnt)
2616 return (cp1 < cp2) ? (-1) : 1;
2642 use_original_str1 =
true;
2643 if (cp1 < (
unsigned int) alpha_cnt)
2645 memcpy (l_array_1, &(casing_arr[cp1 * casing_multiplier]), casing_multiplier *
sizeof (
unsigned int));
2647 if (cp1 != l_array_1[0])
2649 l_count_1 = casing_multiplier;
2650 while (l_count_1 > 1 && l_array_1[l_count_1 - 1] == 0)
2655 use_original_str1 =
false;
2659 use_original_str2 =
true;
2660 if (cp2 < (
unsigned int) alpha_cnt)
2662 memcpy (l_array_2, &(casing_arr[cp2 * casing_multiplier]), casing_multiplier *
sizeof (
unsigned int));
2664 if (cp2 != l_array_2[0])
2666 l_count_2 = casing_multiplier;
2667 while (l_count_2 > 1 && l_array_2[l_count_2 - 1] == 0)
2672 use_original_str2 =
false;
2676 if (use_original_str1)
2681 if (use_original_str2)
2686 l_count = MIN (l_count_1, l_count_2);
2688 if (use_original_str1)
2690 l_count_1 = MIN (l_count, l_count_1);
2691 skip_len1 = l_count_1;
2698 if (use_original_str2)
2700 l_count_2 = MIN (l_count, l_count_2);
2701 skip_len2 = l_count_2;
2708 if (l_count_1 != l_count_2)
2710 return (l_count_1 < l_count_2) ? (-1) : (1);
2713 assert (l_count_1 == l_count_2);
2716 res = memcmp (l_array_1, l_array_2, l_count *
sizeof (
unsigned int));
2748 str1_size =
strlen (str1);
2749 str2_size =
strlen (str2);
2767 int str1_size, str2_size;
2788 return strcmp (str1, str2);
2805 const char *cp1 = str1;
2806 const char *cp2 = str2;
2807 int str1_size, str2_size;
2811 str1_size =
strlen (cp1);
2812 str2_size =
strlen (cp2);
2839 int src_size, src_lower_size;
2847 #if (INTL_IDENTIFIER_CASING_SIZE_MULTIPLIER > 1) 2850 unsigned char *next;
2851 const unsigned char *s;
2854 int s_size = src_size;
2863 for (s = usrc; s < usrc + src_size;)
2869 if (cp < (
unsigned int) (alphabet->
l_count))
2874 for (lower_cnt = 0; lower_cnt < alphabet->
lower_multiplier && *lower_cp != 0; lower_cnt++, lower_cp++)
2889 src_lower_size = src_size;
2897 src_lower_size = src_size;
2901 return src_lower_size;
2916 int length_in_bytes = 0;
2917 int length_in_chars = 0;
2919 const unsigned char *s;
2923 length_in_bytes =
strlen (src);
2943 for (d = udst, s = usrc; d < udst + length_in_bytes; d++, s++)
2953 for (d = udst, s = usrc; d < udst + length_in_bytes; d++, s++)
2975 int src_size, src_upper_size;
2985 #if (INTL_IDENTIFIER_CASING_SIZE_MULTIPLIER > 1) 2988 unsigned char *next;
2989 const unsigned char *s;
2992 int s_size = src_size;
3000 for (s = usrc; s < usrc + src_size;)
3006 if (cp < (
unsigned int) (alphabet->
l_count))
3011 for (upper_cnt = 0; upper_cnt < alphabet->
upper_multiplier && *upper_cp != 0; upper_cnt++, upper_cp++)
3026 src_upper_size = src_size;
3034 src_upper_size = src_size;
3038 return src_upper_size;
3053 int length_in_bytes = 0;
3054 int length_in_chars = 0;
3056 const unsigned char *s;
3060 length_in_bytes =
strlen (src);
3079 for (d = udst, s = usrc; d < udst + length_in_bytes; d++, s++)
3088 for (d = udst, s = usrc; d < udst + length_in_bytes; d++, s++)
3127 int truncated_size = 0, original_size = 0, char_size = 0;
3128 const unsigned char *cname = (
unsigned char *) name;
3133 if (ident_max_size == -1)
3140 original_size =
strlen (name);
3143 if (original_size > ident_max_size)
3145 name[ident_max_size] =
'\0';
3159 if (ident_max_size < original_size)
3161 original_size = ident_max_size;
3165 for (truncated_size = 0; truncated_size < original_size;)
3168 truncated_size += char_size;
3170 assert (truncated_size >= original_size);
3174 if (truncated_size > original_size)
3177 assert ((
unsigned char) *(cname - char_size) > 0x80);
3179 truncated_size -= char_size;
3180 original_size = truncated_size;
3182 name[original_size] =
'\0';
3186 #if (INTL_IDENTIFIER_CASING_SIZE_MULTIPLIER > 1) 3190 if (error_on_case_overflow)
3204 goto check_truncation;
3224 unsigned const char *byte_p = (
unsigned char *) key;
3235 int key_size =
strlen ((
const char *) key);
3236 unsigned char *next;
3238 for (hash = 0; key_size > 0;)
3241 if (ch < (
unsigned int) (alphabet->
l_count))
3250 hash = (hash << 5) - hash + ch;
3255 for (hash = 0; *byte_p; byte_p++)
3265 hash = (hash << 5) - hash + ch;
3269 for (hash = 0; *byte_p; byte_p++)
3272 hash = (hash << 5) - hash + ch;
3277 for (hash = 0; *byte_p; byte_p++)
3280 hash = (hash << 5) - hash + ch;
3285 return hash % ht_size;
3288 #if defined (ENABLE_UNUSED_FUNCTION) 3301 intl_strncat (
unsigned char *dest,
const unsigned char *src,
int len)
3308 unsigned char *p_dest = dest +
strlen ((
char *) dest);
3309 const unsigned char *p_char =
NULL;
3312 while (*src && copy_len < len)
3322 memcpy (p_dest, p_char, char_len);
3327 result = p_dest - dest;
3331 strncat ((
char *) dest, (
char *) src, len);
3367 memcpy (dest, char_p, char_len);
3374 memcpy (dest, char_p, char_len);
3407 if (space_size !=
NULL)
3415 if (str_end ==
NULL)
3417 if (*((
unsigned char *) str) == 0xa1 && *((
unsigned char *) (str + 1)) == 0xa1)
3419 if (space_size !=
NULL)
3434 if (*((
const unsigned char *) str) == 0xa1 && str + 1 < str_end
3435 && *((
const unsigned char *) (str + 1)) == 0xa1)
3437 if (space_size !=
NULL)
3454 if (str_end ==
NULL)
3495 if (str_end ==
NULL)
3497 while (*str !=
'\0')
3499 if (*((
unsigned char *) str) == 0xa1 && *((
unsigned char *) (str + 1)) == 0xa1)
3516 while (str < str_end)
3518 if (*((
const unsigned char *) str) == 0xa1 && str + 1 < str_end
3519 && *((
const unsigned char *) (str + 1)) == 0xa1)
3539 if (str_end ==
NULL)
3580 while (str_end > str_begin)
3582 if (*((
const unsigned char *) str_end) == 0xa1 && str_end - 1 > str_begin
3583 && *((
const unsigned char *) (str_end - 1)) == 0xa1)
3625 if (codepoint <= 0x7f)
3628 *utf8_seq = (
unsigned char) codepoint;
3631 if (codepoint <= 0x7ff)
3634 *utf8_seq++ = (
unsigned char) (0xc0 | (codepoint >> 6));
3635 *utf8_seq = (
unsigned char) (0x80 | (codepoint & 0x3f));
3638 if (codepoint <= 0xffff)
3641 *utf8_seq++ = (
unsigned char) (0xe0 | (codepoint >> 12));
3642 *utf8_seq++ = (
unsigned char) (0x80 | ((codepoint >> 6) & 0x3f));
3643 *utf8_seq = (
unsigned char) (0x80 | (codepoint & 0x3f));
3646 if (codepoint <= 0x10ffff)
3649 *utf8_seq++ = (
unsigned char) (0xf0 | (codepoint >> 18));
3650 *utf8_seq++ = (
unsigned char) (0x80 | ((codepoint >> 12) & 0x3f));
3651 *utf8_seq++ = (
unsigned char) (0x80 | ((codepoint >> 6) & 0x3f));
3652 *utf8_seq = (
unsigned char) (0x80 | (codepoint & 0x3f));
3672 intl_cp_to_dbcs (
const unsigned int codepoint,
const unsigned char *byte_flag,
unsigned char *seq)
3679 if (codepoint <= 0xff)
3681 if (byte_flag[codepoint] == 0)
3684 *seq = (
unsigned char) codepoint;
3693 if (codepoint <= 0xffff)
3696 *seq++ = (
unsigned char) (0xff & (codepoint >> 8));
3697 *seq = (
unsigned char) (codepoint & 0xff);
3723 *next_char = (
unsigned char *) utf8 + 1;
3724 return (
unsigned int) (utf8[0]);
3726 else if (size >= 2 && utf8[0] >= 0xc0 && utf8[0] < 0xe0)
3728 *next_char = (
unsigned char *) utf8 + 2;
3729 return (
unsigned int) (((utf8[0] & 0x1f) << 6) | (utf8[1] & 0x3f));
3731 else if (size >= 3 && utf8[0] >= 0xe0 && utf8[0] < 0xf0)
3733 *next_char = (
unsigned char *) utf8 + 3;
3734 return (
unsigned int) (((utf8[0] & 0x0f) << 12) | ((utf8[1] & 0x3f) << 6) | (utf8[2] & 0x3f));
3736 else if (size >= 4 && utf8[0] >= 0xf0 && utf8[0] < 0xf8)
3738 *next_char = (
unsigned char *) utf8 + 4;
3739 return (
unsigned int) (((utf8[0] & 0x07) << 18) | ((utf8[1] & 0x3f) << 12) | ((utf8[2] & 0x3f) << 6) |
3742 #if INTL_UTF8_MAX_CHAR_SIZE > 4 3743 else if (size >= 5 && utf8[0] >= 0xf8 && utf8[0] < 0xfc)
3745 *next_char = (
unsigned char *) utf8 + 5;
3746 return (
unsigned int) (((utf8[0] & 0x03) << 24) | ((utf8[1] & 0x3f) << 18) | ((utf8[2] & 0x3f) << 12) |
3747 ((utf8[3] & 0x3f) << 6) | (utf8[4] & 0x3f));
3749 else if (size >= 6 && utf8[0] >= 0xfc && utf8[0] < 0xfe)
3751 *next_char = (
unsigned char *) utf8 + 6;
3752 return (
unsigned int) (((utf8[0] & 0x01) << 30) | ((utf8[1] & 0x3f) << 24) | ((utf8[2] & 0x3f) << 18) |
3753 ((utf8[3] & 0x3f) << 12) | ((utf8[4] & 0x3f) << 6) | (utf8[5] & 0x3f));
3757 *next_char = (
unsigned char *) utf8 + 1;
3774 unsigned char **last_byte__prev_char)
3777 unsigned char *dummy;
3781 assert (utf8_start <= utf8_last);
3784 if (*utf8_last < 0x80)
3786 *last_byte__prev_char = ((
unsigned char *) utf8_last) - 1;
3793 if (((*utf8_last--) & 0xc0) != 0x80)
3797 if (utf8_last < utf8_start)
3800 *last_byte__prev_char = ((
unsigned char *) utf8_start) - 1;
3806 *last_byte__prev_char = (
unsigned char *) utf8_last;
3820 intl_dbcs_to_cp (
const unsigned char *seq,
const int size,
const unsigned char *byte_flag,
unsigned char **next_char)
3828 if (byte_flag[seq[0]] == 1 && size >= 2)
3830 *next_char = (
unsigned char *) seq + 2;
3831 return (
unsigned int) (((seq[0]) << 8) | (seq[1]));
3834 *next_char = (
unsigned char *) seq + 1;
3835 return (
unsigned int) (seq[0]);
3854 unsigned char *next =
NULL;
3855 const unsigned char *utf8_end = utf8 + size;
3861 assert (max_array_size > 0);
3864 for (i = 0, *array_count = 0; utf8 < utf8_end; i++)
3867 assert (utf8_end - utf8 > 0);
3872 if (i < max_array_size)
3882 #define UTF8_BYTE_IN_RANGE(b, r1, r2) (!(b < r1 || b > r2)) 3913 #define OUTPUT(charp_out) if (pos != NULL) *pos = (char *) charp_out 3915 const unsigned char *
p = buf;
3916 const unsigned char *p_end =
NULL;
3917 const unsigned char *curr_char =
NULL;
3926 size =
strlen ((
char *) buf);
4029 else if (*p == 0xed)
4134 else if (*p == 0xf4)
4201 #define OUTPUT(charp_out) if (pos != NULL) *pos = (char *) charp_out 4203 const unsigned char *
p = buf;
4204 const unsigned char *p_end =
NULL;
4205 const unsigned char *curr_char =
NULL;
4214 size =
strlen ((
char *) buf);
4301 #if !defined (SERVER_MODE) 4312 const char BOM[] = { (char) 0xef, (
char) 0xbb, (char) 0xbf };
4315 return (memcmp (buf, BOM, 3) == 0) ?
true :
false;
4319 if (*buf == BOM[0] && buf[1] == BOM[1] && buf[2] == BOM[2])
4347 (
unsigned char **) out_buf, out_size);
4368 const unsigned char *p_in =
NULL;
4369 unsigned char *p_out =
NULL;
4371 bool is_ascii =
true;
4381 while (p_in < in_buf + in_size)
4383 if (*p_in++ >= 0x80)
4396 if (*out_buf ==
NULL)
4399 *out_buf = (
unsigned char *) malloc (in_size * 2 + 1);
4400 if (*out_buf ==
NULL)
4408 if (*out_size < in_size * 2 + 1)
4416 for (p_in = in_buf, p_out = *out_buf; p_in < in_buf + in_size; p_in++)
4418 if (*p_in >= txt_conv->
text_first_cp && *p_in <= txt_conv->text_last_cp)
4425 *p_out++ = *utf8_bytes++;
4427 while (--utf8_size > 0);
4464 const unsigned char *p_in =
NULL;
4465 unsigned char *p_out =
NULL;
4466 unsigned char *p_next =
NULL;
4468 bool is_ascii =
true;
4475 p_in = (
const unsigned char *) in_buf;
4476 while (p_in < (
const unsigned char *) in_buf + in_size)
4478 if (*p_in++ >= 0x80)
4491 if (*out_buf ==
NULL)
4493 *out_buf = (
char *) malloc (in_size + 1);
4494 if (*out_buf ==
NULL)
4502 if (*out_size < in_size + 1)
4509 for (p_in = (
const unsigned char *) in_buf, p_out = (
unsigned char *) *out_buf;
4510 p_in < (
const unsigned char *) in_buf + in_size;)
4512 unsigned int cp = 0;
4521 if (cp >= txt_conv->
utf8_first_cp && cp <= txt_conv->utf8_last_cp)
4533 *p_out++ = (
unsigned char) cp;
4539 *out_size =
CAST_STRLEN (p_out - (
unsigned char *) *(out_buf));
4555 for (i = 0; i <= 0x7e; i++)
4557 iso8859_1_To_utf8_conv[
i].
size = 1;
4558 *((
unsigned char *) (iso8859_1_To_utf8_conv[i].bytes)) = (
unsigned char)
i;
4562 for (i = 0x7f; i <= 0x9f; i++)
4564 iso8859_1_To_utf8_conv[
i].
size = 1;
4565 *((
unsigned char *) (iso8859_1_To_utf8_conv[i].bytes)) = (
unsigned char)
'?';
4569 for (i = 0xa0; i <= 0xff; i++)
4594 const unsigned int iso8859_9_special_mapping[][2] = {
4604 for (i = 0; i <= 0x7e; i++)
4606 iso8859_9_To_utf8_conv[
i].
size = 1;
4607 *((
unsigned char *) (iso8859_9_To_utf8_conv[i].bytes)) = (
unsigned char)
i;
4611 for (i = 0x7f; i <= 0x9f; i++)
4613 iso8859_9_To_utf8_conv[
i].
size = 1;
4614 *((
unsigned char *) (iso8859_9_To_utf8_conv[i].bytes)) = (
unsigned char)
'?';
4618 for (i = 0xa0; i <= 0xff; i++)
4630 for (i = 0; i < DIM (iso8859_9_special_mapping); i++)
4632 unsigned int val8bit = iso8859_9_special_mapping[
i][0];
4633 unsigned int cp = iso8859_9_special_mapping[
i][1];
4635 iso8859_9_To_utf8_conv[val8bit].
size =
intl_cp_to_utf8 (cp, iso8859_9_To_utf8_conv[val8bit].bytes);
4667 (
unsigned char **) out_buf, out_size);
4687 const unsigned char *p_in =
NULL;
4688 unsigned char *p_out =
NULL;
4690 bool is_ascii =
true;
4700 while (p_in < in_buf + in_size)
4702 if (*p_in++ >= 0x80)
4715 if (*out_buf ==
NULL)
4720 *out_buf = (
unsigned char *) malloc (in_size * 3 + 1);
4721 if (*out_buf ==
NULL)
4729 if (*out_size < in_size * 3 + 1)
4737 for (p_in = in_buf, p_out = *out_buf; p_in < in_buf + in_size;)
4739 unsigned char *p_next;
4740 unsigned int text_cp =
4743 if (text_cp >= txt_conv->
text_first_cp && text_cp <= txt_conv->text_last_cp)
4750 *p_out++ = *utf8_bytes++;
4752 while (--utf8_size > 0);
4766 assert (p_next <= in_buf + in_size);
4791 const unsigned char *p_in =
NULL;
4792 unsigned char *p_out =
NULL;
4793 unsigned char *p_next =
NULL;
4795 bool is_ascii =
true;
4802 p_in = (
const unsigned char *) in_buf;
4803 while (p_in < (
const unsigned char *) in_buf + in_size)
4805 if (*p_in++ >= 0x80)
4818 if (*out_buf ==
NULL)
4820 *out_buf = (
char *) malloc (in_size + 1);
4821 if (*out_buf ==
NULL)
4829 if (*out_size < in_size + 1)
4838 for (p_in = (
const unsigned char *) in_buf, p_out = (
unsigned char *) *out_buf;
4839 p_in < (
const unsigned char *) in_buf + in_size;)
4841 unsigned int cp = 0;
4850 if (cp >= txt_conv->
utf8_first_cp && cp <= txt_conv->utf8_last_cp)
4858 *p_out++ = *text_bytes++;
4860 while (--text_size > 0);
4868 *p_out++ = (
unsigned char) cp;
4874 *out_size =
CAST_STRLEN (p_out - (
unsigned char *) *(out_buf));
4895 const unsigned char *p_in =
NULL;
4896 const unsigned char *p_end;
4897 unsigned char *p_out =
NULL;
4905 for (p_in = in_buf, p_end = p_in + in_size, p_out = (
unsigned char *) *out_buf; p_in < p_end; p_in++)
4911 else if (*p_in < 0xa0)
4919 *p_out++ = (
unsigned char) (0xc0 | (*p_in >> 6));
4920 *p_out++ = (
unsigned char) (0x80 | (*p_in & 0x3f));
4944 const unsigned char *p_in =
NULL;
4945 const unsigned char *p_end;
4946 unsigned char *p_out =
NULL;
4947 unsigned int unicode_cp;
4955 for (p_in = in_buf, p_end = p_in + in_size, p_out = (
unsigned char *) *out_buf; p_in < p_end; p_in++)
4961 else if (*p_in >= 0xa1 && *p_in < 0xff && p_end - p_in >= 2)
4963 if (*(p_in + 1) >= 0xa1 && *(p_in + 1) < 0xff)
4966 unsigned char ksc_buf[2];
4968 ksc_buf[0] = *p_in - 0x80;
4969 ksc_buf[1] = *(p_in + 1) - 0x80;
4978 if ((unicode_cp <= 0x1F) || (unicode_cp > 0xFF) || ((unicode_cp >= 0x7F) && (unicode_cp <= 0x9F)))
4985 *p_out++ = unicode_cp;
4998 else if (*p_in == 0x8f && p_end - p_in >= 3)
5000 if (*(p_in + 1) >= 0xa1 && *(p_in + 1) < 0xff && *(p_in + 2) >= 0xa1 && *(p_in + 2) < 0xff)
5003 unsigned char jis_buf[2];
5005 jis_buf[0] = *(p_in + 1) - 0x80;
5006 jis_buf[1] = *(p_in + 2) - 0x80;
5015 if ((unicode_cp <= 0x1F) || (unicode_cp > 0xFF) || ((unicode_cp >= 0x7F) && (unicode_cp <= 0x9F)))
5022 *p_out++ = unicode_cp;
5062 intl_euckr_to_utf8 (
const unsigned char *in_buf,
const int in_size,
unsigned char **out_buf,
int *out_size)
5064 const unsigned char *p_in =
NULL;
5065 const unsigned char *p_end;
5066 unsigned char *p_out =
NULL;
5067 unsigned int unicode_cp;
5076 for (p_in = in_buf, p_end = p_in + in_size, p_out = (
unsigned char *) *out_buf; p_in < p_end; p_in++)
5082 else if (*p_in >= 0xa1 && *p_in < 0xff && p_end - p_in >= 2)
5084 if (*(p_in + 1) >= 0xa1 && *(p_in + 1) < 0xff)
5087 unsigned char ksc_buf[2];
5089 ksc_buf[0] = *p_in - 0x80;
5090 ksc_buf[1] = *(p_in + 1) - 0x80;
5112 else if (*p_in == 0x8f && p_end - p_in >= 3)
5114 if (*(p_in + 1) >= 0xa1 && *(p_in + 1) < 0xff && *(p_in + 2) >= 0xa1 && *(p_in + 2) < 0xff)
5117 unsigned char jis_buf[2];
5119 jis_buf[0] = *(p_in + 1) - 0x80;
5120 jis_buf[1] = *(p_in + 2) - 0x80;
5170 const unsigned char *p_in =
NULL;
5171 const unsigned char *p_end;
5172 unsigned char *p_out =
NULL;
5173 unsigned char *next_utf8;
5175 unsigned int unicode_cp = 0;
5182 for (p_in = in_buf, p_end = in_buf + in_size, p_out = (
unsigned char *) *out_buf; p_in < p_end;)
5186 if ((unicode_cp > 0xFF) || ((unicode_cp >= 0x7F) && (unicode_cp <= 0x9F)))
5193 *p_out++ = unicode_cp;
5217 intl_utf8_to_euckr (
const unsigned char *in_buf,
const int in_size,
unsigned char **out_buf,
int *out_size)
5219 const unsigned char *p_in =
NULL;
5220 const unsigned char *p_end;
5221 unsigned char *p_out =
NULL;
5229 for (p_in = in_buf, p_end = p_in + in_size, p_out = (
unsigned char *) *out_buf; p_in < p_end;)
5237 unsigned char euc_buf[2];
5239 unsigned int unicode_cp;
5240 unsigned char *next_utf8;
5243 if (unicode_cp == 0xffffffff)
5254 *p_out = euc_buf[0] + 0x80;
5255 *(p_out + 1) = euc_buf[1] + 0x80;
5274 *(p_out + 1) = euc_buf[0] + 0x80;
5275 *(p_out + 2) = euc_buf[1] + 0x80;
5310 const unsigned char *p_in =
NULL;
5311 const unsigned char *p_end;
5312 unsigned char *p_out =
NULL;
5320 for (p_in = in_buf, p_end = p_in + in_size, p_out = (
unsigned char *) *out_buf; p_in < p_end; p_in++)
5328 unsigned char euc_buf[2];
5345 *p_out = euc_buf[0] + 0x80;
5346 *(p_out + 1) = euc_buf[1] + 0x80;
5366 *(p_out + 1) = euc_buf[0] + 0x80;
5367 *(p_out + 2) = euc_buf[1] + 0x80;
5577 int src_len =
strlen (src);
5590 if (src_len >= symbol_len && symbol_len > 0
5594 *symbol_size = symbol_len;
5605 if (src_len >= symbol_len && symbol_len > 0
5609 *symbol_size = symbol_len;
5617 for (sym_currency = 0; src_len > 0 && sym_currency < (int) DIM (
moneysymbols_utf8); sym_currency++)
5620 if (src_len >= symbol_len && symbol_len > 0 && !memcmp (src,
moneysymbols_utf8[sym_currency], symbol_len))
5623 *symbol_size = symbol_len;
5631 for (sym_currency = 0; src_len > 0 && sym_currency < (int) DIM (
moneysymbols_console); sym_currency++)
5634 if (src_len >= symbol_len && symbol_len > 0 && !memcmp (src,
moneysymbols_console[sym_currency], symbol_len))
5637 *symbol_size = symbol_len;
5646 for (sym_currency = (
int) DIM (
moneysymbols_grammar) - 1; src_len > 0 && sym_currency >= 0; sym_currency--)
5649 if (src_len >= symbol_len && symbol_len > 0 && !memcmp (src,
moneysymbols_grammar[sym_currency], symbol_len))
5652 *symbol_size = symbol_len;
5663 if (src_len >= symbol_len && symbol_len > 0
5667 *symbol_size = symbol_len;
5836 const unsigned char *
p = in_buf;
5837 const unsigned char *p_end =
NULL;
5838 const unsigned char *curr_char =
NULL;
5839 unsigned char *p_out =
NULL;
5841 p_out = (
unsigned char *) *out_buf;
5842 p_end = in_buf + in_size;
5876 *p_out++ = *(p - 1);
5908 *p_out++ = *(p - 2);
5909 *p_out++ = *(p - 1);
5944 *p_out++ = *(p - 2);
5945 *p_out++ = *(p - 1);
5956 else if (*p == 0xed)
5976 *p_out++ = *(p - 2);
5977 *p_out++ = *(p - 1);
6018 *p_out++ = *(p - 3);
6019 *p_out++ = *(p - 2);
6020 *p_out++ = *(p - 1);
6061 *p_out++ = *(p - 3);
6062 *p_out++ = *(p - 2);
6063 *p_out++ = *(p - 1);
6075 else if (*p == 0xf4)
6104 *p_out++ = *(p - 3);
6105 *p_out++ = *(p - 2);
6106 *p_out++ = *(p - 1);
6142 const unsigned char *
p = in_buf;
6143 const unsigned char *p_end =
NULL;
6144 const unsigned char *curr_char =
NULL;
6145 unsigned char *p_out =
NULL;
6147 p_out = (
unsigned char *) *out_buf;
6148 p_end = in_buf + in_size;
6171 *p_out++ = *(p - 3);
6172 *p_out++ = *(p - 2);
6173 *p_out++ = *(p - 1);
6187 *p_out++ = *(p - 2);
6188 *p_out++ = *(p - 1);
int intl_identifier_ncasecmp(const char *str1, const char *str2, const int len)
static int intl_tolower_euc(const unsigned char *src, unsigned char *d, int byte_size)
unsigned char bytes[TEXT_CONV_MAX_BYTES]
int intl_lower_string(const ALPHABET_DATA *alphabet, const unsigned char *src, unsigned char *dst, int length_in_chars)
int intl_mbs_len(const char *mbs)
CONV_CP_TO_BYTES * utf8_to_text
TEXT_CONVERSION con_Iso_8859_1_conv
bool intl_String_validation
int intl_toupper_iso8859(unsigned char *s, int length)
char * intl_get_money_ISO88591_symbol(const DB_CURRENCY currency)
int intl_identifier_casecmp_w_size(const INTL_LANG lang_id, unsigned char *str1, unsigned char *str2, const int size_str1, const int size_str2)
int intl_pad_size(INTL_CODESET codeset)
static int intl_tolower_utf8(const ALPHABET_DATA *a, const unsigned char *s, unsigned char *d, int length_in_chars, int *d_size)
char * intl_mbs_chr(const char *mbs, wchar_t wc)
#define INTL_NEXT_CHAR(ptr, s, codeset, current_char_size)
#define OUTPUT(charp_out)
int intl_text_single_byte_to_utf8(const char *in_buf, const int in_size, char **out_buf, int *out_size)
static int jisx0212_wctomb(unsigned char *r, ucs4_t wc, int n)
static int intl_char_toupper_utf8(const ALPHABET_DATA *a, const unsigned char *s, const int size, unsigned char *d, unsigned char **next)
const char * intl_mbs_nth(const char *mbs, size_t n)
static int intl_count_utf8_bytes(const unsigned char *s, int length_in_chars)
static int jisx0212_mbtowc(ucs4_t *pwc, const unsigned char *s, int n)
void intl_binary_to_euckr(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
int intl_identifier_upper_string_size(const char *src)
int intl_get_currency_symbol_position(const DB_CURRENCY currency)
enum intl_utf8_validity INTL_UTF8_VALIDITY
#define ISO_8859_9_LAST_CP
static void intl_init_conv_iso8859_1_to_utf8(void)
#define ER_QSTR_BAD_SRC_CODESET
static int intl_toupper_euc(const unsigned char *src, unsigned char *d, int byte_size)
bool intl_is_space(const char *str, const char *str_end, const INTL_CODESET codeset, int *space_size)
int intl_cp_to_utf8(const unsigned int codepoint, unsigned char *utf8_seq)
const unsigned char * intl_prev_char(const unsigned char *s, const unsigned char *s_start, INTL_CODESET codeset, int *prev_char_size)
int intl_case_match_tok(const INTL_LANG lang_id, const INTL_CODESET codeset, unsigned char *tok, unsigned char *src, const int size_tok, const int size_src, int *matched_size_src)
bool intl_is_max_bound_chr(INTL_CODESET codeset, const unsigned char *chr)
const unsigned char * intl_nextchar_euc(const unsigned char *s, int *curr_char_length)
const unsigned char * intl_prevchar_utf8(const unsigned char *s, const unsigned char *s_start, int *prev_char_length)
int intl_mbs_spn(const char *mbs, const wchar_t *chars)
int intl_count_utf8_chars(const unsigned char *s, int length_in_bytes)
INTL_ZONE intl_zone(int category)
static char moneysymbols_console[][4]
static CONV_CP_TO_BYTES iso8859_1_To_utf8_conv[256]
static int intl_count_euc_chars(const unsigned char *s, int length_in_bytes)
char * intl_mbs_ncpy(char *mbs1, const char *mbs2, size_t n)
const LANG_LOCALE_DATA * lang_locale(void)
char * intl_get_money_symbol_grammar(const DB_CURRENCY currency)
#define REINTERPRET_CAST(dest_type, expr)
int intl_euckr_to_utf8(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
int intl_identifier_lower(const char *src, char *dst)
static char moneysymbols_iso88591_codes[][4]
int intl_put_char(unsigned char *dest, const unsigned char *char_p, const INTL_CODESET codeset)
unsigned int intl_back_utf8_to_cp(const unsigned char *utf8_start, const unsigned char *utf8_last, unsigned char **last_byte__prev_char)
bool intl_is_min_bound_chr(INTL_CODESET codeset, const unsigned char *chr)
INTL_CODESET lang_charset(void)
int char_islower_iso8859(int c)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
static void intl_init_conv_iso8859_9_to_utf8(void)
CONV_CP_TO_BYTES * text_to_utf8
int intl_text_utf8_to_dbcs(const char *in_buf, const int in_size, char **out_buf, int *out_size)
ALPHABET_DATA ident_alphabet
enum currency_check_mode CURRENCY_CHECK_MODE
int intl_text_utf8_to_single_byte(const char *in_buf, const int in_size, char **out_buf, int *out_size)
static char moneysymbols_grammar[][5]
INTL_UTF8_VALIDITY intl_check_utf8(const unsigned char *buf, int size, char **pos)
int intl_identifier_namecmp(const char *str1, const char *str2)
void intl_pad_char(const INTL_CODESET codeset, unsigned char *pad_char, int *pad_size)
static int intl_strcasecmp_utf8_one_cp(const ALPHABET_DATA *alphabet, unsigned char *str1, unsigned char *str2, const int size_str1, const int size_str2, unsigned int cp1, unsigned int cp2, int *skip_size1, int *skip_size2)
unsigned int text_first_cp
#define ER_OUT_OF_VIRTUAL_MEMORY
const unsigned char * intl_nextchar_utf8(const unsigned char *s, int *curr_char_length)
const char * intl_skip_spaces(const char *str, const char *str_end, const INTL_CODESET codeset)
int char_toupper_iso8859(int c)
bool intl_is_currency_symbol(const char *src, DB_CURRENCY *currency, int *symbol_size, const CURRENCY_CHECK_MODE check_mode)
unsigned int intl_identifier_mht_1strlowerhash(const void *key, const unsigned int ht_size)
int intl_identifier_cmp(const char *str1, const char *str2)
int intl_identifier_casecmp(const char *str1, const char *str2)
unsigned int intl_dbcs_to_cp(const unsigned char *seq, const int size, const unsigned char *byte_flag, unsigned char **next_char)
static int ksc5601_mbtowc(ucs4_t *pwc, const unsigned char *s, int n)
#define DB_MAX_IDENTIFIER_LENGTH
int intl_iso88591_to_euckr(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
static int intl_toupper_utf8(const ALPHABET_DATA *a, const unsigned char *s, unsigned char *d, int length_in_chars, int *d_size)
unsigned int utf8_first_cp
static int intl_char_tolower_utf8(const ALPHABET_DATA *a, const unsigned char *s, const int size, unsigned char *d, unsigned char **next)
static char moneysymbols_esc_iso_codes[][5]
static int ksc5601_wctomb(unsigned char *r, ucs4_t wc, int n)
void intl_binary_to_utf8(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
bool intl_is_bom_magic(const char *buf, const int size)
static const unsigned char len_utf8_char[256]
unsigned int intl_utf8_to_cp(const unsigned char *utf8, const int size, unsigned char **next_char)
static int intl_count_euc_bytes(const unsigned char *s, int length_in_chars)
unsigned int utf8_last_cp
int intl_char_size(const unsigned char *src, int length_in_chars, INTL_CODESET src_codeset, int *byte_count)
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
const LANG_LOCALE_DATA * lang_get_specific_locale(const INTL_LANG lang, const INTL_CODESET codeset)
int intl_text_dbcs_to_utf8_ext(void *t, const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
const char * intl_backskip_spaces(const char *str_begin, const char *str_end, const INTL_CODESET codeset)
int intl_euckr_to_iso88591(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
#define INTL_GET_NEXTCHAR_UTF8(c, l)
#define INTL_UTF8_MAX_CHAR_SIZE
unsigned char byte_flag[256]
int intl_utf8_to_cp_list(const unsigned char *utf8, const int size, unsigned int *cp_array, const int max_array_size, int *array_count)
int intl_cp_to_dbcs(const unsigned int codepoint, const unsigned char *byte_flag, unsigned char *seq)
int intl_identifier_lower_string_size(const char *src)
static CONV_CP_TO_BYTES iso8859_9_To_utf8_conv[256]
int intl_lower_string_size(const ALPHABET_DATA *alphabet, const unsigned char *src, int src_size, int src_length)
int intl_set_min_bound_chr(INTL_CODESET codeset, char *chr)
int intl_mbs_ncasecmp(const char *mbs1, const char *mbs2, size_t n)
char * intl_get_money_symbol_console(const DB_CURRENCY currency)
int char_tolower_iso8859(int c)
char * intl_get_money_symbol(const DB_CURRENCY currency, INTL_CODESET codeset)
enum intl_codeset INTL_CODESET
int intl_char_count(const unsigned char *src, int length_in_bytes, INTL_CODESET src_codeset, int *char_count)
int intl_utf8_to_euckr(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
bool prm_get_bool_value(PARAM_ID prm_id)
static CONV_CP_TO_BYTES utf8_Cp_to_iso_8859_9_conv[ISO_8859_9_LAST_CP-ISO_8859_9_FIRST_CP+1]
int intl_mbs_casecmp(const char *mbs1, const char *mbs2)
char * intl_get_money_ISO_symbol(const DB_CURRENCY currency)
int intl_cmp_char(const unsigned char *s1, const unsigned char *s2, INTL_CODESET codeset, int *char_size)
int char_isupper_iso8859(int c)
int intl_identifier_fix(char *name, int ident_max_size, bool error_on_case_overflow)
#define CHAR_BYTE_TO_UPPER(c)
TEXT_CONVERSION con_Iso_8859_9_conv
INTL_UTF8_VALIDITY intl_check_euckr(const unsigned char *buf, int size, char **pos)
int intl_upper_string(const ALPHABET_DATA *alphabet, const unsigned char *src, unsigned char *dst, int length_in_chars)
int intl_text_dbcs_to_utf8(const char *in_buf, const int in_size, char **out_buf, int *out_size)
static char moneysymbols_utf8[][4]
int intl_convert_charset(const unsigned char *src, int length_in_chars, INTL_CODESET src_codeset, unsigned char *dest, INTL_CODESET dest_codeset, int *unconverted)
TEXT_CONVERSION * lang_get_txt_conv(void)
#define INTL_CASING_EXPANSION_MULTIPLIER
int intl_reverse_string(const unsigned char *src, unsigned char *dst, int length_in_chars, int size_in_bytes, INTL_CODESET codeset)
unsigned int text_last_cp
INTL_UTF8_VALIDITY intl_check_string(const char *buf, int size, char **pos, const INTL_CODESET codeset)
const unsigned char * intl_next_char(const unsigned char *s, INTL_CODESET codeset, int *current_char_size)
#define CHAR_BYTE_TO_LOWER(c)
int intl_tolower_iso8859(unsigned char *s, int length)
#define INTL_CODESET_MULT(codeset)
int intl_set_max_bound_chr(INTL_CODESET codeset, char *chr)
int intl_fast_iso88591_to_utf8(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
char * intl_get_money_UTF8_symbol(const DB_CURRENCY currency)
int intl_utf8_to_iso88591(const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
const unsigned char * intl_prevchar_euc(const unsigned char *s, const unsigned char *s_start, int *prev_char_length)
int intl_upper_string_size(const ALPHABET_DATA *alphabet, const unsigned char *src, int src_size, int src_length)
int intl_identifier_upper(const char *src, char *dst)
static char moneysymbols_iso_codes[][4]
#define ISO_8859_9_FIRST_CP
char * intl_get_money_esc_ISO_symbol(const DB_CURRENCY currency)
#define UTF8_BYTE_IN_RANGE(b, r1, r2)
int intl_text_single_byte_to_utf8_ext(void *t, const unsigned char *in_buf, const int in_size, unsigned char **out_buf, int *out_size)
const unsigned char *const intl_Len_utf8_char