andrei Tue Sep 13 17:07:47 2005 EDT Modified files: /php-src README.UNICODE-UPGRADES Log: http://cvs.php.net/diff.php/php-src/README.UNICODE-UPGRADES?r1=1.2&r2=1.3&ty=u Index: php-src/README.UNICODE-UPGRADES diff -u php-src/README.UNICODE-UPGRADES:1.2 php-src/README.UNICODE-UPGRADES:1.3 --- php-src/README.UNICODE-UPGRADES:1.2 Tue Sep 13 16:24:02 2005 +++ php-src/README.UNICODE-UPGRADES Tue Sep 13 17:07:46 2005 @@ -158,6 +158,7 @@ version. It returns the key as a char* pointer, you can can cast it appropriately based on the key type. + Identifiers and Class Entries ----------------------------- @@ -174,6 +175,47 @@ ce = U_CLASS_ENTRY(default_exception_ce); +Formatted Output +---------------- + +Since UTF-16 strings frequently contain NULL bytes, you cannot simpley use +%s format to print them out. Towards that end, output functions such as +php_printf(), spprintf(), etc now have three different formats for use with +Unicode strings: + + %r + This format treats the corresponding argument as a Unicode string. The + string is automatically converted to the output encoding. If you wish to + apply a different converter to the string, use %*r and pass the + converter before the string argument. + + UChar *class_name = USTR_NAME("ReflectionClass"); + zend_printf("%r", class_name); + + %R + This format requires at least two arguments: the first one specifies the + type of the string to follow (IS_STRING or IS_UNICODE), and the second + one - the string itself. If the string is of Unicode type, it is + automatically converted to the output encoding. If you wish to apply + a different converter to the string, use %*R and pass the converter + before the string argument. + + zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, + "Interface %R does not exist", + Z_TYPE_P(class_name), Z_UNIVAL_P(class_name)); + + %v + This format takes only one parameter, the string, but the expected + string type depends on the UG(unicode) value. If the string is of + Unicode type, it is automatically converted to the output encoding. If + you wish to apply a different converter to the string, use %*R and pass + the converter before the string argument. + + zend_error(E_WARNING, "%v::__toString() did not return anything", + Z_OBJCE_P(object)->name); + + + References ==========
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php