Lines Matching refs:enc

1501 	const mbfl_encoding *enc = mbfl_name2encoding(name);  in PHP_FUNCTION()  local
1502 if (enc == NULL) { in PHP_FUNCTION()
1507 const char *preferred_name = mbfl_encoding_preferred_mime_name(enc); in PHP_FUNCTION()
1653 const mbfl_encoding *enc = php_mb_get_encoding(encoding, 3); in PHP_FUNCTION() local
1654 if (!enc) { in PHP_FUNCTION()
1664 unsigned int char_len = enc->flag & (MBFL_ENCTYPE_SBCS | MBFL_ENCTYPE_WCS2 | MBFL_ENCTYPE_WCS4); in PHP_FUNCTION()
1673 } else if (enc->mblen_table) { in PHP_FUNCTION()
1674 unsigned char const *mbtab = enc->mblen_table; in PHP_FUNCTION()
1701 size_t out_len = enc->to_wchar(&p, &in_len, wchar_buf, 128, &state); in PHP_FUNCTION()
1710 enc->from_wchar(wchar_buf, split_len - char_count, &buf, true); in PHP_FUNCTION()
1713 add_next_index_str(return_value, mb_convert_buf_result(&buf, enc)); in PHP_FUNCTION()
1717 enc->from_wchar(wchar_buf, out_len, &buf, !in_len); in PHP_FUNCTION()
1728 enc->from_wchar(wchar_buf + i, split_len, &buf, true); in PHP_FUNCTION()
1730 add_next_index_str(return_value, mb_convert_buf_result(&buf, enc)); in PHP_FUNCTION()
1734 enc->from_wchar(wchar_buf + i, out_len - i, &buf, !in_len); in PHP_FUNCTION()
1744 add_next_index_str(return_value, mb_convert_buf_result(&buf, enc)); in PHP_FUNCTION()
1854 const mbfl_encoding *enc = php_mb_get_encoding(enc_name, 2); in PHP_FUNCTION() local
1855 if (!enc) { in PHP_FUNCTION()
1859 RETVAL_LONG(mb_get_strlen(string, enc)); in PHP_FUNCTION()
1900 static size_t mb_find_strpos(zend_string *haystack, zend_string *needle, const mbfl_encoding *enc, … in mb_find_strpos() argument
1906 if (!php_mb_is_no_encoding_utf8(enc->no_encoding)) { in mb_find_strpos()
1908 …haystack_u8 = mb_fast_convert((unsigned char*)ZSTR_VAL(haystack), ZSTR_LEN(haystack), enc, &mbfl_e… in mb_find_strpos()
1909 …needle_u8 = mb_fast_convert((unsigned char*)ZSTR_VAL(needle), ZSTR_LEN(needle), enc, &mbfl_encodin… in mb_find_strpos()
1985 const mbfl_encoding *enc = php_mb_get_encoding(enc_name, 4); in PHP_FUNCTION() local
1986 if (!enc) { in PHP_FUNCTION()
1990 size_t n = mb_find_strpos(haystack, needle, enc, offset, false); in PHP_FUNCTION()
2014 const mbfl_encoding *enc = php_mb_get_encoding(enc_name, 4); in PHP_FUNCTION() local
2015 if (!enc) { in PHP_FUNCTION()
2019 size_t n = mb_find_strpos(haystack, needle, enc, offset, true); in PHP_FUNCTION()
2044 const mbfl_encoding *enc = php_mb_get_encoding(from_encoding, 4); in PHP_FUNCTION() local
2045 if (!enc) { in PHP_FUNCTION()
2049 size_t n = php_mb_stripos(false, haystack, needle, offset, enc); in PHP_FUNCTION()
2075 const mbfl_encoding *enc = php_mb_get_encoding(from_encoding, 4); in PHP_FUNCTION() local
2076 if (!enc) { in PHP_FUNCTION()
2080 size_t n = php_mb_stripos(true, haystack, needle, offset, enc); in PHP_FUNCTION()
2091 …et_substr_slow(unsigned char *in, size_t in_len, size_t from, size_t len, const mbfl_encoding *enc) in mb_get_substr_slow() argument
2100 size_t out_len = enc->to_wchar(&in, &in_len, wchar_buf, 128, &state); in mb_get_substr_slow()
2107 enc->from_wchar(wchar_buf + from, needed_codepoints, &buf, !in_len || out_len >= len); in mb_get_substr_slow()
2113 return mb_convert_buf_result(&buf, enc); in mb_get_substr_slow()
2116 …c zend_string* mb_get_substr(zend_string *input, size_t from, size_t len, const mbfl_encoding *enc) in mb_get_substr() argument
2121 if (len == 0 || (from >= in_len && enc != &mbfl_encoding_sjis_mac)) { in mb_get_substr()
2130 unsigned int flag = enc->flag & (MBFL_ENCTYPE_SBCS | MBFL_ENCTYPE_WCS2 | MBFL_ENCTYPE_WCS4); in mb_get_substr()
2146 return mb_get_substr_slow(in, in_len, from, len, enc); in mb_get_substr()
2169 const mbfl_encoding *enc = php_mb_get_encoding(encoding_name, 4); in php_mb_strstr_variants() local
2170 if (!enc) { in php_mb_strstr_variants()
2179 n = php_mb_stripos(reverse_mode, haystack, needle, 0, enc); in php_mb_strstr_variants()
2181 n = mb_find_strpos(haystack, needle, enc, 0, reverse_mode); in php_mb_strstr_variants()
2186 RETVAL_STR(mb_get_substr(haystack, 0, n, enc)); in php_mb_strstr_variants()
2188 RETVAL_STR(mb_get_substr(haystack, n, MBFL_SUBSTR_UNTIL_END, enc)); in php_mb_strstr_variants()
2245 const mbfl_encoding *enc = php_mb_get_encoding(enc_name, 3); in PHP_FUNCTION() local
2246 if (!enc) { in PHP_FUNCTION()
2250 if (php_mb_is_no_encoding_utf8(enc->no_encoding)) { in PHP_FUNCTION()
2257 …haystack_u8 = mb_fast_convert((unsigned char*)ZSTR_VAL(haystack), ZSTR_LEN(haystack), enc, &mbfl_e… in PHP_FUNCTION()
2267 …needle_u8 = mb_fast_convert((unsigned char*)ZSTR_VAL(needle), ZSTR_LEN(needle), enc, &mbfl_encodin… in PHP_FUNCTION()
2274 …haystack_u8 = mb_fast_convert((unsigned char*)ZSTR_VAL(haystack), ZSTR_LEN(haystack), enc, &mbfl_e… in PHP_FUNCTION()
2275 …needle_u8 = mb_fast_convert((unsigned char*)ZSTR_VAL(needle), ZSTR_LEN(needle), enc, &mbfl_encodin… in PHP_FUNCTION()
2339 const mbfl_encoding *enc = php_mb_get_encoding(encoding, 4); in PHP_FUNCTION() local
2340 if (!enc) { in PHP_FUNCTION()
2346 mblen = mb_get_strlen(str, enc); in PHP_FUNCTION()
2371 RETVAL_STR(mb_get_substr(str, real_from, real_len, enc)); in PHP_FUNCTION()
2392 const mbfl_encoding *enc = php_mb_get_encoding(encoding, 4); in PHP_FUNCTION() local
2393 if (!enc) { in PHP_FUNCTION()
2398 string.encoding = enc; in PHP_FUNCTION()
2426 if (enc->cut) { in PHP_FUNCTION()
2427 RETURN_STR(enc->cut(string.val, from, len, string.val + string.len)); in PHP_FUNCTION()
2440 if (enc->mblen_table) { in PHP_FUNCTION()
2441 const unsigned char *mbtab = enc->mblen_table; in PHP_FUNCTION()
2494 static size_t mb_get_strwidth(zend_string *string, const mbfl_encoding *enc) in mb_get_strwidth() argument
2503 size_t out_len = enc->to_wchar(&in, &in_len, wchar_buf, 128, &state); in mb_get_strwidth()
2528 const mbfl_encoding *enc = php_mb_get_encoding(enc_name, 2); in PHP_FUNCTION() local
2529 if (!enc) { in PHP_FUNCTION()
2533 RETVAL_LONG(mb_get_strwidth(string, enc)); in PHP_FUNCTION()
2536 …_trim_string(zend_string *input, zend_string *marker, const mbfl_encoding *enc, size_t from, size_… in mb_trim_string() argument
2549 out_len = enc->to_wchar(&in, &in_len, wchar_buf, 128, &state); in mb_trim_string()
2562 size_t marker_width = mb_get_strwidth(marker, enc); in mb_trim_string()
2597 return mb_get_substr(input, from, MBFL_SUBSTR_UNTIL_END, enc); in mb_trim_string()
2603 …et_substr_slow((unsigned char*)ZSTR_VAL(input), ZSTR_LEN(input), from, MBFL_SUBSTR_UNTIL_END, enc); in mb_trim_string()
2615 out_len = enc->to_wchar(&in, &in_len, wchar_buf, 128, &state); in mb_trim_string()
2625 enc->from_wchar(wchar_buf + from, i - from, &buf, true); in mb_trim_string()
2631 enc->from_wchar(wchar_buf + from, out_len - from, &buf, false); in mb_trim_string()
2662 const mbfl_encoding *enc = php_mb_get_encoding(encoding, 5); in PHP_FUNCTION() local
2663 if (!enc) { in PHP_FUNCTION()
2668 size_t str_len = mb_get_strlen(str, enc); in PHP_FUNCTION()
2681 width += mb_get_strwidth(str, enc); in PHP_FUNCTION()
2684 zend_string *trimmed = mb_get_substr(str, 0, from, enc); in PHP_FUNCTION()
2685 width -= mb_get_strwidth(trimmed, enc); in PHP_FUNCTION()
2695 RETVAL_STR(mb_trim_string(str, trimmarker, enc, from, width)); in PHP_FUNCTION()
2904 …ng_convert_case(php_case_mode case_mode, const char *str, size_t str_len, const mbfl_encoding *enc) in mbstring_convert_case() argument
2906 …return php_unicode_convert_case(case_mode, str, str_len, enc, enc, MBSTRG(current_filter_illegal_m… in mbstring_convert_case()
2921 const mbfl_encoding *enc = php_mb_get_encoding(from_encoding, 3); in PHP_FUNCTION() local
2922 if (!enc) { in PHP_FUNCTION()
2931 RETURN_STR(mbstring_convert_case(case_mode, ZSTR_VAL(str), ZSTR_LEN(str), enc)); in PHP_FUNCTION()
2944 const mbfl_encoding *enc = php_mb_get_encoding(from_encoding, 2); in PHP_FUNCTION() local
2945 if (!enc) { in PHP_FUNCTION()
2949 RETURN_STR(mbstring_convert_case(PHP_UNICODE_CASE_UPPER, ZSTR_VAL(str), ZSTR_LEN(str), enc)); in PHP_FUNCTION()
2962 const mbfl_encoding *enc = php_mb_get_encoding(from_encoding, 2); in PHP_FUNCTION() local
2963 if (!enc) { in PHP_FUNCTION()
2967 RETURN_STR(mbstring_convert_case(PHP_UNICODE_CASE_LOWER, ZSTR_VAL(str), ZSTR_LEN(str), enc)); in PHP_FUNCTION()
2980 const mbfl_encoding *enc = php_mb_get_encoding(from_encoding, 2); in php_mb_ulcfirst() local
2981 if (!enc) { in php_mb_ulcfirst()
2985 zend_string *first = mb_get_substr(str, 0, 1, enc); in php_mb_ulcfirst()
2986 zend_string *head = mbstring_convert_case(mode, ZSTR_VAL(first), ZSTR_LEN(first), enc); in php_mb_ulcfirst()
2994 zend_string *second = mb_get_substr(str, 1, MBFL_SUBSTR_UNTIL_END, enc); in php_mb_ulcfirst()
3034 … uint32_t *default_chars, size_t default_chars_length, mb_trim_mode mode, const mbfl_encoding *enc) in trim_each_wchar() argument
3046 out_len = enc->to_wchar(&in, &in_len, wchar_buf, 128, &state); in trim_each_wchar()
3071 return mb_get_substr(str, left, total_len - (right + left), enc); in trim_each_wchar()
3074 …c zend_string* mb_trim_default_chars(zend_string *str, mb_trim_mode mode, const mbfl_encoding *enc) in mb_trim_default_chars() argument
3093 zend_string* retval = trim_each_wchar(str, &what_ht, NULL, 0, mode, enc); in mb_trim_default_chars()
3099 …b_trim_what_chars(zend_string *str, zend_string *what, mb_trim_mode mode, const mbfl_encoding *enc) in mb_trim_what_chars() argument
3111 what_out_len = enc->to_wchar(&what_in, &what_len, what_wchar_buf, 128, &state); in mb_trim_what_chars()
3115 return trim_each_wchar(str, NULL, what_wchar_buf, what_out_len, mode, enc); in mb_trim_what_chars()
3133 zend_string *retval = trim_each_wchar(str, &what_ht, NULL, 0, mode, enc); in mb_trim_what_chars()
3152 const mbfl_encoding *enc = php_mb_get_encoding(encoding, 3); in php_do_mb_trim() local
3153 if (!enc) { in php_do_mb_trim()
3158 RETURN_STR(mb_trim_what_chars(str, what, mode, enc)); in php_do_mb_trim()
3160 RETURN_STR(mb_trim_default_chars(str, mode, enc)); in php_do_mb_trim()
3231 const mbfl_encoding *enc; member
3244 const mbfl_encoding *enc = encodings[i]; in init_candidate_array() local
3246 array[j].enc = enc; in init_candidate_array()
3252 if (enc->check != NULL) { in init_candidate_array()
3254 if (!enc->check((unsigned char*)in[k], in_len[k])) { in init_candidate_array()
3278 const mbfl_encoding *enc = array[i].enc; in start_string() local
3284 if (enc == &mbfl_encoding_utf8) { in start_string()
3289 } else if (enc == &mbfl_encoding_utf16be) { in start_string()
3294 } else if (enc == &mbfl_encoding_utf16le) { in start_string()
3319 const mbfl_encoding *enc = array[i].enc; in count_demerits() local
3320 …size_t out_len = enc->to_wchar((unsigned char**)&array[i].in, &array[i].in_len, wchar_buf, 128, &a… in count_demerits()
3396 return array[best].enc; in mb_guess_encoding_for_strings()
3683 const mbfl_encoding *enc = php_mb_get_encoding(encname, 3); in PHP_FUNCTION() local
3684 if (!enc) { in PHP_FUNCTION()
3688 RETVAL_STR(jp_kana_convert(str, enc, opt)); in PHP_FUNCTION()
4047 const mbfl_encoding *enc = php_mb_get_encoding(encoding, 3); in PHP_FUNCTION() local
4048 if (!enc) { in PHP_FUNCTION()
4057 RETVAL_STR(html_numeric_entity_encode(str, enc, convmap, conversion_map_size, is_hex)); in PHP_FUNCTION()
4277 const mbfl_encoding *enc = php_mb_get_encoding(encoding, 3); in PHP_FUNCTION() local
4278 if (!enc) { in PHP_FUNCTION()
4287 RETVAL_STR(html_numeric_entity_decode(str, enc, convmap, conversion_map_size)); in PHP_FUNCTION()
4605 const mbfl_encoding *enc = MBSTRG(current_internal_encoding); in PHP_FUNCTION() local
4606 if (enc == &mbfl_encoding_pass) { in PHP_FUNCTION()
4607enc = mb_guess_encoding((unsigned char*)ZSTR_VAL(subject), ZSTR_LEN(subject), MBSTRG(current_detec… in PHP_FUNCTION()
4612 …subject = mb_mime_header_encode(subject, enc, tran_cs, head_enc == &mbfl_encoding_base64, (char*)l… in PHP_FUNCTION()
5625 zend_string *input_str = NULL, *enc = NULL; in PHP_FUNCTION() local
5632 Z_PARAM_STR_OR_NULL(enc) in PHP_FUNCTION()
5635 encoding = php_mb_get_encoding(enc, 2); in PHP_FUNCTION()
5657 const mbfl_encoding *enc; in php_mb_ord() local
5662 enc = php_mb_get_encoding(enc_name, enc_name_arg_num); in php_mb_ord()
5663 if (!enc) { in php_mb_ord()
5667 no_enc = enc->no_encoding; in php_mb_ord()
5669 zend_value_error("mb_ord() does not support the \"%s\" encoding", enc->name); in php_mb_ord()
5677 …size_t out_len = enc->to_wchar((unsigned char**)&str, &str_len, wchar_buf, MBSTRING_MIN_WCHAR_BUFS… in php_mb_ord()
5691 zend_string *enc = NULL; in PHP_FUNCTION() local
5697 Z_PARAM_STR_OR_NULL(enc) in PHP_FUNCTION()
5705 cp = php_mb_ord(str, str_len, enc, 2); in PHP_FUNCTION()
5720 const mbfl_encoding *enc; in php_mb_chr() local
5725 enc = php_mb_get_encoding(enc_name, enc_name_arg_num); in php_mb_chr()
5726 if (!enc) { in php_mb_chr()
5730 no_enc = enc->no_encoding; in php_mb_chr()
5732 zend_value_error("mb_chr() does not support the \"%s\" encoding", enc->name); in php_mb_chr()
5777 ret = php_mb_convert_encoding_ex(buf, 4, enc, &mbfl_encoding_ucs4be); in php_mb_chr()
5792 zend_string *enc = NULL; in PHP_FUNCTION() local
5797 Z_PARAM_STR_OR_NULL(enc) in PHP_FUNCTION()
5800 zend_string* ret = php_mb_chr(cp, enc, 2); in PHP_FUNCTION()
5946 const mbfl_encoding *enc = php_mb_get_encoding(enc_name, 2); in PHP_FUNCTION() local
5947 if (!enc) { in PHP_FUNCTION()
5951 if (enc == &mbfl_encoding_utf8 && ZSTR_IS_VALID_UTF8(str)) { in PHP_FUNCTION()
5956 RETURN_STR(php_mb_convert_encoding_ex(ZSTR_VAL(str), ZSTR_LEN(str), enc, enc)); in PHP_FUNCTION()
5991 MBSTRING_API size_t php_mb_mbchar_bytes(const char *s, const mbfl_encoding *enc) in php_mb_mbchar_bytes() argument
5993 if (enc) { in php_mb_mbchar_bytes()
5994 if (enc->mblen_table) { in php_mb_mbchar_bytes()
5996 return enc->mblen_table[*(unsigned char *)s]; in php_mb_mbchar_bytes()
5998 } else if (enc->flag & MBFL_ENCTYPE_WCS2) { in php_mb_mbchar_bytes()
6000 } else if (enc->flag & MBFL_ENCTYPE_WCS4) { in php_mb_mbchar_bytes()
6007 …I char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc) in php_mb_safe_strrchr() argument
6020 nb = php_mb_mbchar_bytes(p, enc); in php_mb_safe_strrchr()
6035 nbytes_char = php_mb_mbchar_bytes(p, enc); in php_mb_safe_strrchr()
6046 …(bool mode, zend_string *haystack, zend_string *needle, zend_long offset, const mbfl_encoding *enc) in php_mb_stripos() argument
6050 …case(PHP_UNICODE_CASE_FOLD_SIMPLE, ZSTR_VAL(haystack), ZSTR_LEN(haystack), enc, &mbfl_encoding_utf… in php_mb_stripos()
6051 …ert_case(PHP_UNICODE_CASE_FOLD_SIMPLE, ZSTR_VAL(needle), ZSTR_LEN(needle), enc, &mbfl_encoding_utf… in php_mb_stripos()