mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Unicode support
This commit is contained in:
parent
09a3c92df7
commit
e56f9d2eea
1 changed files with 10 additions and 3 deletions
|
@ -797,7 +797,14 @@ int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node expo
|
||||||
php_libxml_initialize();
|
php_libxml_initialize();
|
||||||
export_hnd.export_func = export_function;
|
export_hnd.export_func = export_function;
|
||||||
|
|
||||||
return zend_hash_add(&php_libxml_exports, ce->name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL);
|
if (zend_hash_add(&php_libxml_exports, ce->name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL) == SUCCESS) {
|
||||||
|
UChar *uname;
|
||||||
|
|
||||||
|
uname = malloc(UBYTES(ce->name_length+1));
|
||||||
|
u_charsToUChars(ce->name, uname, ce->name_length+1);
|
||||||
|
return zend_u_hash_add(&php_libxml_exports, IS_UNICODE, uname, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL);
|
||||||
|
}
|
||||||
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
|
PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
|
||||||
|
@ -811,10 +818,10 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
|
||||||
while (ce->parent != NULL) {
|
while (ce->parent != NULL) {
|
||||||
ce = ce->parent;
|
ce = ce->parent;
|
||||||
}
|
}
|
||||||
if (zend_hash_find(&php_libxml_exports, ce->name, ce->name_length + 1, (void **) &export_hnd) == SUCCESS) {
|
if (zend_u_hash_find(&php_libxml_exports, UG(unicode)?IS_UNICODE:IS_STRING, ce->name, ce->name_length + 1, (void **) &export_hnd) == SUCCESS) {
|
||||||
node = export_hnd->export_func(object TSRMLS_CC);
|
node = export_hnd->export_func(object TSRMLS_CC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue