mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
implement zend_unicode_to_string() and zend_string_to_unicode()
part #2 (of 2)
This commit is contained in:
parent
f5715ee86f
commit
dbe2092313
18 changed files with 41 additions and 41 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue