@@ -427,28 +427,28 @@ ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
427
427
} while (0)
428
428
#define add_assoc_rt_stringl_ex (arg , key , key_len , str , length , flags ) do { \
429
429
if (UG(unicode)) { \
430
- UErrorCode ___status = U_ZERO_ERROR; \
431
430
UChar *___u_str; \
432
431
int ___u_len; \
433
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
432
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
433
+ add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
434
+ } \
434
435
if ((flags) & ZSTR_AUTOFREE) { \
435
436
efree(str); \
436
437
} \
437
- add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
438
438
} else { \
439
439
add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
440
440
} \
441
441
} while (0)
442
442
#define add_assoc_utf8_stringl_ex (arg , key , key_len , str , length , flags ) do { \
443
443
if (UG(unicode)) { \
444
- UErrorCode ___status = U_ZERO_ERROR; \
445
444
UChar *___u_str; \
446
445
int ___u_len; \
447
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
446
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
447
+ add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
448
+ } \
448
449
if ((flags) & ZSTR_AUTOFREE) { \
449
450
efree(str); \
450
451
} \
451
- add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
452
452
} else { \
453
453
add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
454
454
} \
@@ -570,28 +570,28 @@ ZEND_API int add_ascii_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *v
570
570
} while (0)
571
571
#define add_ascii_assoc_rt_stringl_ex (arg , key , key_len , str , length , flags ) do { \
572
572
if (UG(unicode)) { \
573
- UErrorCode ___status = U_ZERO_ERROR; \
574
573
UChar *___u_str; \
575
574
int ___u_len; \
576
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
575
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
576
+ add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
577
+ } \
577
578
if ((flags) & ZSTR_AUTOFREE) { \
578
579
efree(str); \
579
580
} \
580
- add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
581
581
} else { \
582
582
add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
583
583
} \
584
584
} while (0)
585
585
#define add_ascii_assoc_utf8_stringl_ex (arg , key , key_len , str , length , flags ) do { \
586
586
if (UG(unicode)) { \
587
- UErrorCode ___status = U_ZERO_ERROR; \
588
587
UChar *___u_str; \
589
588
int ___u_len; \
590
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
589
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
590
+ add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
591
+ } \
591
592
if ((flags) & ZSTR_AUTOFREE) { \
592
593
efree(str); \
593
594
} \
594
- add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
595
595
} else { \
596
596
add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
597
597
} \
@@ -714,28 +714,28 @@ ZEND_API int add_rt_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *valu
714
714
} while (0)
715
715
#define add_rt_assoc_rt_stringl_ex (arg , key , key_len , str , length , flags ) do { \
716
716
if (UG(unicode)) { \
717
- UErrorCode ___status = U_ZERO_ERROR; \
718
717
UChar *___u_str; \
719
718
int ___u_len; \
720
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
719
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
720
+ add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
721
+ } \
721
722
if ((flags) & ZSTR_AUTOFREE) { \
722
723
efree(str); \
723
724
} \
724
- add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
725
725
} else { \
726
726
add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
727
727
} \
728
728
} while (0)
729
729
#define add_rt_assoc_utf8_stringl_ex (arg , key , key_len , str , length , flags ) do { \
730
730
if (UG(unicode)) { \
731
- UErrorCode ___status = U_ZERO_ERROR; \
732
731
UChar *___u_str; \
733
732
int ___u_len; \
734
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
733
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
734
+ add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
735
+ } \
735
736
if ((flags) & ZSTR_AUTOFREE) { \
736
737
efree(str); \
737
738
} \
738
- add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
739
739
} else { \
740
740
add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
741
741
} \
@@ -858,28 +858,28 @@ ZEND_API int add_utf8_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *va
858
858
} while (0)
859
859
#define add_utf8_assoc_rt_stringl_ex (arg , key , key_len , str , length , flags ) do { \
860
860
if (UG(unicode)) { \
861
- UErrorCode ___status = U_ZERO_ERROR; \
862
861
UChar *___u_str; \
863
862
int ___u_len; \
864
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
863
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
864
+ add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
865
+ } \
865
866
if ((flags) & ZSTR_AUTOFREE) { \
866
867
efree(str); \
867
868
} \
868
- add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
869
869
} else { \
870
870
add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
871
871
} \
872
872
} while (0)
873
873
#define add_utf8_assoc_utf8_stringl_ex (arg , key , key_len , str , length , flags ) do { \
874
874
if (UG(unicode)) { \
875
- UErrorCode ___status = U_ZERO_ERROR; \
876
875
UChar *___u_str; \
877
876
int ___u_len; \
878
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
877
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
878
+ add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
879
+ } \
879
880
if ((flags) & ZSTR_AUTOFREE) { \
880
881
efree(str); \
881
882
} \
882
- add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
883
883
} else { \
884
884
add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
885
885
} \
@@ -1012,28 +1012,28 @@ ZEND_API int add_utf8_property_zval_ex(zval *arg, char *key, uint key_len, zval
1012
1012
} while (0)
1013
1013
#define add_utf8_property_rt_stringl_ex (arg , key , key_len , str , length , flags ) do { \
1014
1014
if (UG(unicode)) { \
1015
- UErrorCode ___status = U_ZERO_ERROR; \
1016
1015
UChar *___u_str; \
1017
1016
int ___u_len; \
1018
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
1017
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
1018
+ add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
1019
+ } \
1019
1020
if ((flags) & ZSTR_AUTOFREE) { \
1020
1021
efree(str); \
1021
1022
} \
1022
- add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
1023
1023
} else { \
1024
1024
add_utf8_property_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1025
1025
} \
1026
1026
} while (0)
1027
1027
#define add_utf8_property_utf8_stringl_ex (arg , key , key_len , str , length , flags ) do { \
1028
1028
if (UG(unicode)) { \
1029
- UErrorCode ___status = U_ZERO_ERROR; \
1030
1029
UChar *___u_str; \
1031
1030
int ___u_len; \
1032
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
1031
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
1032
+ add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
1033
+ } \
1033
1034
if ((flags) & ZSTR_AUTOFREE) { \
1034
1035
efree(str); \
1035
1036
} \
1036
- add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
1037
1037
} else { \
1038
1038
add_utf8_property_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1039
1039
} \
@@ -1130,28 +1130,28 @@ ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_
1130
1130
} while (0)
1131
1131
#define add_u_assoc_rt_stringl_ex (arg , type , key , key_len , str , length , flags ) do { \
1132
1132
if (UG(unicode)) { \
1133
- UErrorCode ___status = U_ZERO_ERROR; \
1134
1133
UChar *___u_str; \
1135
1134
int ___u_len; \
1136
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
1135
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
1136
+ add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
1137
+ } \
1137
1138
if ((flags) & ZSTR_AUTOFREE) { \
1138
1139
efree(str); \
1139
1140
} \
1140
- add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
1141
1141
} else { \
1142
1142
add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1143
1143
} \
1144
1144
} while (0)
1145
1145
#define add_u_assoc_utf8_stringl_ex (arg , type , key , key_len , str , length , flags ) do { \
1146
1146
if (UG(unicode)) { \
1147
- UErrorCode ___status = U_ZERO_ERROR; \
1148
1147
UChar *___u_str; \
1149
1148
int ___u_len; \
1150
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
1149
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
1150
+ add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
1151
+ } \
1151
1152
if ((flags) & ZSTR_AUTOFREE) { \
1152
1153
efree(str); \
1153
1154
} \
1154
- add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
1155
1155
} else { \
1156
1156
add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1157
1157
} \
@@ -1274,28 +1274,28 @@ ZEND_API int add_index_zval(zval *arg, ulong index, zval *value);
1274
1274
} while (0)
1275
1275
#define add_index_rt_stringl (arg , idx , str , length , flags ) do {\
1276
1276
if (UG(unicode)) { \
1277
- UErrorCode ___status = U_ZERO_ERROR; \
1278
1277
UChar *___u_str; \
1279
1278
int ___u_len; \
1280
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
1279
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
1280
+ add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
1281
+ } \
1281
1282
if ((flags) & ZSTR_AUTOFREE) { \
1282
1283
efree(str); \
1283
1284
} \
1284
- add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
1285
1285
} else { \
1286
1286
add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1287
1287
} \
1288
1288
} while (0)
1289
1289
#define add_index_utf8_stringl (arg , idx , str , length , flags ) do { \
1290
1290
if (UG(unicode)) { \
1291
- UErrorCode ___status = U_ZERO_ERROR; \
1292
1291
UChar *___u_str; \
1293
1292
int ___u_len; \
1294
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
1293
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
1294
+ add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
1295
+ } \
1295
1296
if ((flags) & ZSTR_AUTOFREE) { \
1296
1297
efree(str); \
1297
1298
} \
1298
- add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
1299
1299
} else { \
1300
1300
add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1301
1301
} \
@@ -1397,28 +1397,28 @@ ZEND_API int add_next_index_zval(zval *arg, zval *value);
1397
1397
} while (0)
1398
1398
#define add_next_index_rt_stringl (arg , str , length , flags ) do { \
1399
1399
if (UG(unicode)) { \
1400
- UErrorCode ___status = U_ZERO_ERROR; \
1401
1400
UChar *___u_str; \
1402
1401
int ___u_len; \
1403
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
1402
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length) == SUCCESS) { \
1403
+ add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
1404
+ } \
1404
1405
if ((flags) & ZSTR_AUTOFREE) { \
1405
1406
efree(str); \
1406
1407
} \
1407
- add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
1408
1408
} else { \
1409
1409
add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1410
1410
} \
1411
1411
} while (0)
1412
1412
#define add_next_index_utf8_stringl (arg , str , length , flags ) do { \
1413
1413
if (UG(unicode)) { \
1414
- UErrorCode ___status = U_ZERO_ERROR; \
1415
1414
UChar *___u_str; \
1416
1415
int ___u_len; \
1417
- zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
1416
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length) == SUCCESS) { \
1417
+ add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
1418
+ } \
1418
1419
if ((flags) & ZSTR_AUTOFREE) { \
1419
1420
efree(str); \
1420
1421
} \
1421
- add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
1422
1422
} else { \
1423
1423
add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
1424
1424
} \
@@ -1643,16 +1643,16 @@ END_EXTERN_C()
1643
1643
1644
1644
#define ZVAL_U_STRING (conv , z , s , flags ) { \
1645
1645
if (UG(unicode)) { \
1646
- UErrorCode status = U_ZERO_ERROR; \
1647
1646
char *__s = (s); \
1648
1647
int __s_len = strlen(__s); \
1649
1648
UChar *u_str; \
1650
1649
int u_len; \
1651
- zend_string_to_unicode_ex(conv, &u_str, &u_len, __s, __s_len, &status); \
1650
+ if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len) == SUCCESS) { \
1651
+ ZVAL_UNICODEL(z, u_str, u_len, 0); \
1652
+ } \
1652
1653
if ((flags) & ZSTR_AUTOFREE) { \
1653
1654
efree(__s); \
1654
1655
} \
1655
- ZVAL_UNICODEL(z, u_str, u_len, 0); \
1656
1656
} else { \
1657
1657
char *__s=(s); \
1658
1658
Z_STRLEN_P(z) = strlen(__s); \
@@ -1663,16 +1663,16 @@ END_EXTERN_C()
1663
1663
1664
1664
#define ZVAL_U_STRINGL (conv , z , s , l , flags ) { \
1665
1665
if (UG(unicode)) { \
1666
- UErrorCode status = U_ZERO_ERROR; \
1667
1666
char *__s = (s); \
1668
1667
int __s_len = (l); \
1669
1668
UChar *u_str; \
1670
1669
int u_len; \
1671
- zend_string_to_unicode_ex(conv, &u_str, &u_len, __s, __s_len, &status); \
1670
+ if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len) == SUCCESS) { \
1671
+ ZVAL_UNICODEL(z, u_str, u_len, 0); \
1672
+ } \
1672
1673
if ((flags) & ZSTR_AUTOFREE) { \
1673
1674
efree(__s); \
1674
1675
} \
1675
- ZVAL_UNICODEL(z, u_str, u_len, 0); \
1676
1676
} else { \
1677
1677
char *__s=(s); int __l=l; \
1678
1678
Z_STRLEN_P(z) = __l; \
0 commit comments