]> granicus.if.org Git - php/commitdiff
implement zend_unicode_to_string() and zend_string_to_unicode()
authorAntony Dovgal <tony2001@php.net>
Tue, 8 Aug 2006 16:59:11 +0000 (16:59 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 8 Aug 2006 16:59:11 +0000 (16:59 +0000)
part #2 (of 2)

18 files changed:
ext/dom/node.c
ext/pdo/pdo_stmt.c
ext/simplexml/simplexml.c
ext/soap/php_encoding.c
ext/soap/php_http.c
ext/soap/soap.c
ext/sqlite/sqlite.c
ext/standard/array.c
ext/standard/streamsfuncs.c
ext/standard/var.c
ext/unicode/unicode.c
main/output.c
main/php_variables.c
main/rfc1867.c
main/spprintf.c
main/streams/filter.c
main/streams/streams.c
sapi/cli/php_cli_readline.c

index 6d16579e2732295444ec62e994f2e57929300e65..45834387429946088c02b0bbac80fae820558c36 100644 (file)
@@ -1785,7 +1785,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode)
                                        UErrorCode errCode = 0;
 
                                        if (Z_TYPE_PP(tmpns) == IS_UNICODE) {
-                                               zend_convert_from_unicode(UG(utf8_conv), &nschar, &nschar_len, Z_USTRVAL_PP(tmpns), Z_USTRLEN_PP(tmpns), &errCode);
+                                               zend_unicode_to_string_ex(UG(utf8_conv), &nschar, &nschar_len, Z_USTRVAL_PP(tmpns), Z_USTRLEN_PP(tmpns), &errCode);
                                        } else {
                                                nschar = Z_STRVAL_PP(tmpns);
                                        }
@@ -1800,7 +1800,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode)
                                                        int tmp_prefix_len;
                                                        errCode = 0;
 
-                                                       zend_convert_from_unicode(UG(utf8_conv), &tmp_prefix, &tmp_prefix_len, prefix.u, prefix_key_len, &errCode);
+                                                       zend_unicode_to_string_ex(UG(utf8_conv), &tmp_prefix, &tmp_prefix_len, prefix.u, prefix_key_len, &errCode);
                                                        xmlXPathRegisterNs(ctxp, (xmlChar *)tmp_prefix, (xmlChar *)nschar);
                                                        efree(tmp_prefix);
                                                }
@@ -1815,7 +1815,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode)
 
                if (Z_TYPE_PP(zxquery) == IS_UNICODE) {
                        UErrorCode errCode = 0;
-                       zend_convert_from_unicode(UG(utf8_conv), &xquery, &xquery_len, Z_USTRVAL_PP(zxquery), Z_USTRLEN_PP(zxquery), &errCode);
+                       zend_unicode_to_string_ex(UG(utf8_conv), &xquery, &xquery_len, Z_USTRVAL_PP(zxquery), Z_USTRLEN_PP(zxquery), &errCode);
                } else {
                        xquery = Z_STRVAL_PP(zxquery);
                }
@@ -1857,7 +1857,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode)
                                        char *prefix;
                                        int prfeix_len;
 
-                                       zend_convert_from_unicode(UG(utf8_conv), &prefix, &prfeix_len, Z_USTRVAL_PP(tmpns), Z_USTRLEN_PP(tmpns), &errCode);
+                                       zend_unicode_to_string_ex(UG(utf8_conv), &prefix, &prfeix_len, Z_USTRVAL_PP(tmpns), Z_USTRLEN_PP(tmpns), &errCode);
                                        inclusive_ns_prefixes[nscount++] = prefix;
                                }
                                zend_hash_move_forward(Z_ARRVAL_P(ns_prefixes));
index 430bde1af0ef8a236d5aec0ccac5a1f2d2ce3084..8911e3a29f72512e4c23f662e28b46132acf1c12 100755 (executable)
@@ -514,7 +514,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno TSRMLS_DC
                                        UChar *u_str;
                                        int u_len;
                        
-                                       zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, value, value_len, &status);
+                                       zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, value, value_len, &status);
                                        ZVAL_UNICODEL(dest, u_str, u_len, 0);
                                        if (caller_frees) {
                                                efree(value);
index 4278bd11136bfbb773ab9835a24081cd2c8375da..680c066442a11ee276ad1888e124637019119c26 100644 (file)
@@ -2080,7 +2080,7 @@ static int php_sxe_iterator_current_key(zend_object_iterator *iter, zstr *str_ke
                int u_len;
 
                namelen = xmlStrlen(curnode->name);
-               zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &str_key->u, &u_len, (char*)curnode->name, namelen, &status);
+               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &str_key->u, &u_len, (char*)curnode->name, namelen, &status);
                *str_key_len = u_len + 1;
                return HASH_KEY_IS_UNICODE;
        } else {
index 99b70139b490191f4ed6710551c08023174e1f7e..91bf447384c5c4fc0aeb5d8a7a25af208bdf413f 100644 (file)
@@ -3170,7 +3170,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
 
                                ALLOC_INIT_ZVAL(tmp);
                                Z_TYPE_P(tmp) = IS_STRING;
-                               zend_convert_from_unicode(UG(utf8_conv), &Z_STRVAL_P(tmp), &Z_STRLEN_P(tmp), Z_USTRVAL_P(cur_stype), Z_USTRLEN_P(cur_stype), &status);
+                               zend_unicode_to_string_ex(UG(utf8_conv), &Z_STRVAL_P(tmp), &Z_STRLEN_P(tmp), Z_USTRVAL_P(cur_stype), Z_USTRLEN_P(cur_stype), &status);
                                cur_stype = tmp;
                        } else {
                                cur_stype->refcount++;
@@ -3183,7 +3183,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
 
                                ALLOC_INIT_ZVAL(tmp);
                                Z_TYPE_P(tmp) = IS_STRING;
-                               zend_convert_from_unicode(UG(utf8_conv), &Z_STRVAL_P(tmp), &Z_STRLEN_P(tmp), Z_USTRVAL_P(cur_ns), Z_USTRLEN_P(cur_ns), &status);
+                               zend_unicode_to_string_ex(UG(utf8_conv), &Z_STRVAL_P(tmp), &Z_STRLEN_P(tmp), Z_USTRVAL_P(cur_ns), Z_USTRLEN_P(cur_ns), &status);
                                cur_ns = tmp;
                        } else {
                                cur_ns->refcount++;
index b88c17b0138f920d437c17c363323e43927cd257..6032fa0cb4b47428bcc7045d23ef542245cc8161 100644 (file)
@@ -632,7 +632,7 @@ try_again:
                                                                        char *res;
                                                                        int res_len;
 
-                                                                       zend_convert_from_unicode(UG(utf8_conv), &res, &res_len, key.u, key_len-1, &status);
+                                                                       zend_unicode_to_string_ex(UG(utf8_conv), &res, &res_len, key.u, key_len-1, &status);
                                                                        smart_str_appendl(&soap_headers, res, res_len);
                                                                        efree(res);
                                                                }
@@ -644,7 +644,7 @@ try_again:
                                                                        char *res;
                                                                        int res_len;
 
-                                                                       zend_convert_from_unicode(UG(utf8_conv), &res, &res_len, Z_USTRVAL_PP(value), Z_USTRLEN_PP(value), &status);
+                                                                       zend_unicode_to_string_ex(UG(utf8_conv), &res, &res_len, Z_USTRVAL_PP(value), Z_USTRLEN_PP(value), &status);
                                                                        smart_str_appendl(&soap_headers, res, res_len);
                                                                        efree(res);
                                                                }
index 538b05e31a27714a6f93d242615b4ca40b1ad0e7..5593a9bc41f3e52a7f05891ea0d10eaf27589366 100644 (file)
@@ -308,7 +308,7 @@ char* soap_unicode_to_string(UChar *ustr, int ustr_len TSRMLS_DC)
        char *tmp;
        int tmp_len;
 
-       zend_convert_from_unicode(UG(utf8_conv), &tmp, &tmp_len, ustr, ustr_len, &errCode);
+       zend_unicode_to_string_ex(UG(utf8_conv), &tmp, &tmp_len, ustr, ustr_len, &errCode);
        return tmp;
 }
 
index abf06052446532f16e15e8b898cbc79df66abf9a..1c12d7943720b472fb4c697e09e7a12f68453c47 100644 (file)
@@ -1689,7 +1689,7 @@ PHP_FUNCTION(sqlite_fetch_column_types)
                        UChar *u_str;
                        int u_len;
 
-                       zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, tmp, strlen(tmp), &status);
+                       zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, tmp, strlen(tmp), &status);
                        if (result_type == PHPSQLITE_ASSOC) {
                                add_assoc_unicode(return_value, colname, u_str, 1);
                        }
@@ -1857,7 +1857,7 @@ static void php_sqlite_fetch_array(struct php_sqlite_result *res, int mode, zend
                                UChar *u_str;
                                int u_len;
 
-                               zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, (char*)rowdata[j], strlen((char*)rowdata[j]), &status);
+                               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, (char*)rowdata[j], strlen((char*)rowdata[j]), &status);
                                ZVAL_UNICODEL(decoded, u_str, u_len, 0);
                                if (!buffered) {
                                        efree((char *)rowdata[j]);
@@ -1945,7 +1945,7 @@ static void php_sqlite_fetch_column(struct php_sqlite_result *res, zval *which,
                UChar *u_str;
                int u_len;
 
-               zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, (char*)rowdata[j], strlen((char*)rowdata[j]), &status);
+               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, (char*)rowdata[j], strlen((char*)rowdata[j]), &status);
                RETVAL_UNICODEL(u_str, u_len, 0);
                if (!res->buffered) {
                        efree((char *)rowdata[j]);
@@ -2277,7 +2277,7 @@ static void php_sqlite_fetch_single(struct php_sqlite_result *res, zend_bool dec
                UChar *u_str;
                int u_len;
 
-               zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, decoded, decoded_len, &status);
+               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, decoded, decoded_len, &status);
                if (free_decoded) {
                        efree(decoded);
                }
index 03d40c046de0790d3c1fa491ae5fd21da76507fb..b71fae946f13f0230fe734485b07d9ae58c8c4e1 100644 (file)
@@ -1277,7 +1277,7 @@ static int php_extract_prefix_varname(zval *result, zval *prefix, zstr var_name,
                        int buf_len;
                        UErrorCode status = U_ZERO_ERROR;
 
-                       zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
+                       zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
                                                                        &buf, &buf_len, var_name.s, var_name_len, &status);
                        if (U_FAILURE(status)) {
                                zval_dtor(result);
@@ -1304,7 +1304,7 @@ static int php_extract_prefix_varname(zval *result, zval *prefix, zstr var_name,
                        int buf_len;
                        UErrorCode status = U_ZERO_ERROR;
 
-                       zend_convert_from_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
+                       zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
                                                                          &buf, &buf_len, var_name.u, var_name_len, &status);
                        if (U_FAILURE(status)) {
                                zval_dtor(result);
index 2b8dceea6bd1883c6f5af3a53940df998d72ea3f..05f92f315ed04052465c9bef0a1668bd0ea845dc 100644 (file)
@@ -870,7 +870,7 @@ static int parse_context_options(php_stream_context *context, zval *options TSRM
                                char *tmp;
                                int tmp_len;
 
-                               zend_convert_from_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &tmp, &tmp_len, wkey.u, wkey_len, &errCode);
+                               zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &tmp, &tmp_len, wkey.u, wkey_len, &errCode);
                                wkey.s = tmp;
                                wkey_len = tmp_len;
                        }
@@ -884,7 +884,7 @@ static int parse_context_options(php_stream_context *context, zval *options TSRM
                                        char *tmp;
                                        int tmp_len;
        
-                                       zend_convert_from_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &tmp, &tmp_len, okey.u, okey_len, &errCode);
+                                       zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &tmp, &tmp_len, okey.u, okey_len, &errCode);
                                        okey.s = tmp;
                                        okey_len = tmp_len;
                                        php_stream_context_set_option(context, wkey.s, okey.s, *oval);
index 058faea83da7748837546cd35a75264c3ef61531..8cf0af4007823a631d24e7cede64c5788071e94b 100644 (file)
@@ -56,7 +56,7 @@ static void php_var_dump_unicode(UChar *ustr, int length, int verbose, char *quo
                return;
        }
 
-       zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &out, &clen, ustr, length, &status);
+       zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &out, &clen, ustr, length, &status);
        if(U_FAILURE(status)) {
                php_printf("problem converting string from Unicode: %s\n", u_errorName(status));
                efree(out);
index 11948dc39d07ba371640d6c7639e997df55a89fc..9e67e121e40a0f8232291ac3b4e43f535eceb42d 100644 (file)
@@ -60,7 +60,7 @@ static PHP_FUNCTION(unicode_decode)
        zend_set_converter_error_mode(conv, ZEND_TO_UNICODE, flags);
 
        status = U_ZERO_ERROR;
-       num_conv = zend_convert_to_unicode(conv, &dest, &dest_len, str, str_len, &status);
+       num_conv = zend_string_to_unicode_ex(conv, &dest, &dest_len, str, str_len, &status);
        if (U_FAILURE(status)) {
                zend_raise_conversion_error_ex("could not decode binary string", conv, ZEND_TO_UNICODE, num_conv TSRMLS_CC);
                efree(dest);
@@ -111,7 +111,7 @@ static PHP_FUNCTION(unicode_encode)
        zend_set_converter_subst_char(conv, UG(from_subst_char));
 
        status = U_ZERO_ERROR;
-       num_conv = zend_convert_from_unicode(conv, &dest, &dest_len, uni, uni_len, &status);
+       num_conv = zend_unicode_to_string_ex(conv, &dest, &dest_len, uni, uni_len, &status);
        if (U_FAILURE(status)) {
                int32_t offset = u_countChar32(uni, num_conv);
                zend_raise_conversion_error_ex("could not encode Unicode string", conv, ZEND_FROM_UNICODE, offset TSRMLS_CC);
index ba4469e598a8677e5f2d6483afe7106b84834495..7f3435758234484dc79f0729fae97ee2b2273db4 100644 (file)
@@ -243,7 +243,7 @@ PHPAPI int php_output_write_unicode(const UChar *str, size_t len TSRMLS_DC)
                return 0;
        }
        
-       zend_convert_from_unicode(UG(output_encoding_conv), &buf_str, &buf_len, str, len, &status);
+       zend_unicode_to_string_ex(UG(output_encoding_conv), &buf_str, &buf_len, str, len, &status);
        if (U_ZERO_ERROR == status) {
                php_output_op(PHP_OUTPUT_HANDLER_WRITE, buf_str, buf_len TSRMLS_CC);
        }
index ad926bd6318196ee7d2c2af6cad54d4aea5c6558..24c72ab0deb63b5b605e4f119e1e6ffad65fa5e9 100644 (file)
@@ -372,8 +372,8 @@ last_value:
                                php_url_decode(var, var_len);
                                val++;
                                val_len = php_url_decode(val, (p - val));
-                               zend_convert_to_unicode(input_conv, &u_var, &u_var_len, var, var_len, &status1);
-                               zend_convert_to_unicode(input_conv, &u_val, &u_val_len, val, val_len, &status2);
+                               zend_string_to_unicode_ex(input_conv, &u_var, &u_var_len, var, var_len, &status1);
+                               zend_string_to_unicode_ex(input_conv, &u_val, &u_val_len, val, val_len, &status2);
                                if (U_SUCCESS(status1) && U_SUCCESS(status2)) {
                                        /* UTODO add input filtering */
                                        php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC);
@@ -515,7 +515,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
                        int u_var_len, u_val_len;
                        UErrorCode status = U_ZERO_ERROR;
 
-                       zend_convert_to_unicode(input_conv, &u_var, &u_var_len, var, var_len, &status);
+                       zend_string_to_unicode_ex(input_conv, &u_var, &u_var_len, var, var_len, &status);
                        if (U_FAILURE(status)) {
                                /* UTODO set a user-accessible flag to indicate that conversion failed? */
                                efree(u_var);
@@ -527,7 +527,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
                                unsigned int new_val_len;
 
                                val_len = php_url_decode(val, strlen(val));
-                               zend_convert_to_unicode(input_conv, &u_val, &u_val_len, val, val_len, &status);
+                               zend_string_to_unicode_ex(input_conv, &u_val, &u_val_len, val, val_len, &status);
                                if (U_FAILURE(status)) {
                                        /* UTODO set a user-accessible flag to indicate that conversion failed? */
                                        efree(u_var);
index 081a5f94666d8e7cde17322916ad6b861be31d0c..d83a47f3d022c64bb5dc35db717823a6dbb7a72f 100644 (file)
@@ -365,7 +365,7 @@ static inline UChar *php_ap_to_unicode(char *in, int32_t in_len, int32_t *out_le
        }
 
        input_conv = ZEND_U_CONVERTER(UG(output_encoding_conv));
-       zend_convert_to_unicode(input_conv, &buf, &buf_len, in, in_len, &status);
+       zend_string_to_unicode_ex(input_conv, &buf, &buf_len, in, in_len, &status);
        if (U_SUCCESS(status)) {
                if (out_len)
                        *out_len = buf_len;
@@ -1151,7 +1151,7 @@ static SAPI_POST_HANDLER_FUNC(rfc1867_post_handler_unicode)
 
                                if (value) {
                                        /* UTODO use 'charset' parameter for conversion */
-                                       zend_convert_to_unicode(input_conv, &u_val, &u_val_len, value, value_len, &status);
+                                       zend_string_to_unicode_ex(input_conv, &u_val, &u_val_len, value, value_len, &status);
                                        if (U_FAILURE(status)) {
                                                /* UTODO set a user-accessible flag to indicate that conversion failed? */
                                                goto var_done;
index 501c435875de79b380c347e6a16c05cb75dcc231..477c03100f33088a02e24d6dd0214235b117cf1c 100644 (file)
@@ -589,7 +589,7 @@ fmt_unicode:
                                                s = (char*)u;
                                                s_unicode = 1;
                                        } else {
-                                               zend_convert_from_unicode(conv, &res, &s_len, u, u_len, &status);
+                                               zend_unicode_to_string_ex(conv, &res, &s_len, u, u_len, &status);
                                                if (U_FAILURE(status)) {
                                                        php_error(E_WARNING, "Could not convert Unicode to printable form in s[np]printf call");
                                                        return;
index ffac6352978244b6c3828d1929f7cef460b842ce..578eea6967b967ba9b4de982f3483663a6d26301 100644 (file)
@@ -727,13 +727,13 @@ PHPAPI int _php_stream_bucket_convert(php_stream_bucket *bucket, unsigned char t
                        UChar *dest;
                        int destlen;
 
-                       zend_convert_to_unicode(conv, &dest, &destlen, bucket->buf.s, bucket->buflen, &status);
+                       zend_string_to_unicode_ex(conv, &dest, &destlen, bucket->buf.s, bucket->buflen, &status);
 
                        if (bucket->own_buf) {
                                pefree(bucket->buf.s, bucket->is_persistent);
                        }
 
-                       /* Might be dangerous, double check this (or, better, get a persistent version of zend_convert_to_unicode() */
+                       /* Might be dangerous, double check this (or, better, get a persistent version of zend_string_to_unicode_ex() */
                        bucket->is_persistent = 0;
 
                        bucket->buf_type = IS_UNICODE;
@@ -746,7 +746,7 @@ PHPAPI int _php_stream_bucket_convert(php_stream_bucket *bucket, unsigned char t
                        char *dest;
                        int destlen, num_conv;
 
-                       num_conv = zend_convert_from_unicode(conv, &dest, &destlen, bucket->buf.u, bucket->buflen, &status);
+                       num_conv = zend_unicode_to_string_ex(conv, &dest, &destlen, bucket->buf.u, bucket->buflen, &status);
                        if (U_FAILURE(status)) {
                                int32_t offset = u_countChar32(bucket->buf.u, num_conv);
 
index e150cf36fbac119bc20f19cf98f4f403ce3574aa..0ce3883cb0b4f8f98ecd89634738becd41227221 100755 (executable)
@@ -1219,7 +1219,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, int buf_type, zstr bu
                UErrorCode status = U_ZERO_ERROR;
 
                /* Use runtime_encoding to map to binary */
-               num_conv = zend_convert_from_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &str, &len, buf.u, buflen, &status);
+               num_conv = zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &str, &len, buf.u, buflen, &status);
                if (U_FAILURE(status)) {
                        zend_raise_conversion_error_ex("Unable to convert data to be written", ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
                                                                        ZEND_FROM_UNICODE, num_conv TSRMLS_CC);
@@ -2587,7 +2587,7 @@ PHPAPI int _php_stream_path_encode(php_stream_wrapper *wrapper,
                        int scheme_len = 0;
 
                        /* Convert just the scheme using utf8 in order to look it up in the registry */
-                       num_conv = zend_convert_from_unicode(UG(utf8_conv), &scheme, &scheme_len, path, (p - path) + delim_len, &status);
+                       num_conv = zend_unicode_to_string_ex(UG(utf8_conv), &scheme, &scheme_len, path, (p - path) + delim_len, &status);
                        if (U_FAILURE(status)) {
                                if (options & REPORT_ERRORS) {
                                        zend_raise_conversion_error_ex("Unable to convert filepath", UG(utf8_conv), ZEND_FROM_UNICODE, num_conv TSRMLS_CC);
@@ -2624,7 +2624,7 @@ PHPAPI int _php_stream_path_encode(php_stream_wrapper *wrapper,
        /* Otherwise, fallback on filesystem_encoding */
        status = U_ZERO_ERROR;
 
-       num_conv = zend_convert_from_unicode(ZEND_U_CONVERTER(UG(filesystem_encoding_conv)),
+       num_conv = zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(filesystem_encoding_conv)),
                                pathenc, pathenc_len, path, path_len, &status);
        if (U_FAILURE(status)) {
                if (options & REPORT_ERRORS) {
@@ -2666,7 +2666,7 @@ PHPAPI int _php_stream_path_decode(php_stream_wrapper *wrapper,
        }
 
        /* Otherwise fallback on filesystem_encoding */
-       num_conv = zend_convert_to_unicode(ZEND_U_CONVERTER(UG(filesystem_encoding_conv)),
+       num_conv = zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(filesystem_encoding_conv)),
                                pathdec, pathdec_len, path, path_len, &status);
        if (U_FAILURE(status)) {
                if (options & REPORT_ERRORS) {
index 23729d58e681e275aef386665338e2e001ebd857..f08081d0af899c55c05ae54d48d3c407fad99d59 100644 (file)
@@ -312,7 +312,7 @@ static char *cli_completion_generator_var(const char *text, int textlen, int *st
                        UErrorCode status = U_ZERO_ERROR;
 
                        len = u_strlen((UChar *)retval);
-                       zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, 
+                       zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, 
                                                                          (UChar *)retval, len, &status);
 
                        retval = malloc(tmp_len + 2);
@@ -345,7 +345,7 @@ static char *cli_completion_generator_func(const char *text, int textlen, int *s
                        UErrorCode status = U_ZERO_ERROR;
 
                        len = u_strlen((UChar *)func->common.function_name.u);
-                       zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len,
+                       zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len,
                                                                          (UChar *)func->common.function_name.u, len, &status);
 
                        retval = strdup(tmp);
@@ -371,7 +371,7 @@ static char *cli_completion_generator_class(const char *text, int textlen, int *
                        UErrorCode status = U_ZERO_ERROR;
 
                        len = u_strlen((UChar *)(*pce)->name.u);
-                       zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, 
+                       zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, 
                                                                          (UChar *)(*pce)->name.u, len, &status);
 
                        retval = strdup(tmp);
@@ -397,7 +397,7 @@ static char *cli_completion_generator_define(const char *text, int textlen, int
                        UErrorCode status = U_ZERO_ERROR;
 
                        len = u_strlen((UChar *)retval);
-                       zend_convert_from_unicode(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, 
+                       zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp, &tmp_len, 
                                                                          (UChar *)retval, len, &status);
 
                        retval = strdup(tmp);