dmitry Thu Aug 18 03:16:53 2005 EDT Modified files: /php-src/ext/libxml libxml.c Log: Unicode support http://cvs.php.net/diff.php/php-src/ext/libxml/libxml.c?r1=1.32&r2=1.33&ty=u Index: php-src/ext/libxml/libxml.c diff -u php-src/ext/libxml/libxml.c:1.32 php-src/ext/libxml/libxml.c:1.33 --- php-src/ext/libxml/libxml.c:1.32 Wed Aug 3 10:07:23 2005 +++ php-src/ext/libxml/libxml.c Thu Aug 18 03:16:52 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: libxml.c,v 1.32 2005/08/03 14:07:23 sniper Exp $ */ +/* $Id: libxml.c,v 1.33 2005/08/18 07:16:52 dmitry Exp $ */ #define IS_EXT_MODULE @@ -797,7 +797,14 @@ php_libxml_initialize(); 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) @@ -811,10 +818,10 @@ while (ce->parent != NULL) { 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); } - } + } return node;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php