cvs: ZendEngine2 / zend_operators.c
| From: | Andrei Zmievski | Date: | Thu, 23 Mar 2006 21:52:49 +0000 |
| Subject: | cvs: ZendEngine2 / zend_operators.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4759@lists.php.net to get a copy of this message | ||
andrei Thu Mar 23 21:52:49 2006 UTC
Modified files:
/ZendEngine2 zend_operators.c
Log:
Allow conversion between binary/Unicode strings (based on
runtime_encoding setting).
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_operators.c?r1=1.236&r2=1.237&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.236 ZendEngine2/zend_operators.c:1.237
--- ZendEngine2/zend_operators.c:1.236 Thu Mar 16 10:33:23 2006
+++ ZendEngine2/zend_operators.c Thu Mar 23 21:52:49 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_operators.c,v 1.236 2006/03/16 10:33:23 dmitry Exp $ */
+/* $Id: zend_operators.c,v 1.237 2006/03/23 21:52:49 andrei Exp $ */
#include <ctype.h>
@@ -588,7 +588,9 @@
case IS_UNICODE:
break;
case IS_STRING:
- zend_error(E_ERROR, "Cannot convert binary type to Unicode type");
+ if (zval_string_to_unicode(op TSRMLS_CC) == FAILURE) {
+ zend_error(E_WARNING, "Could not convert binary string to Unicode string");
+ }
return;
case IS_BOOL:
if (Z_LVAL_P(op)) {
@@ -668,7 +670,9 @@
case IS_STRING:
return;
case IS_UNICODE:
- zval_unicode_to_string(op, conv TSRMLS_CC);
+ if (zval_unicode_to_string(op, conv TSRMLS_CC) == FAILURE) {
+ zend_error(E_WARNING, "Could not convert Unicode string to binary string");
+ }
break;
case IS_BOOL:
if (Z_LVAL_P(op)) {