cvs: ZendEngine2 / zend_unicode.c /tests bug43477.phpt

[email protected] ("Antony Dovgal")
Newsgroups php.zend-engine.cvs
Message-ID <cvstony20011206101368@cvsserver>
tony2001		Fri Mar 21 12:09:28 2008 UTC

  Added files:                 
    /ZendEngine2/tests	bug43477.phpt 

  Modified files:              
    /ZendEngine2	zend_unicode.c 
  Log:
  fix #43477 (Error mode ignored in unicode_decode())
  patch by Stephen Bach
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_unicode.c?r1=1.37&r2=1.38&diff_format=u
Index: ZendEngine2/zend_unicode.c
diff -u ZendEngine2/zend_unicode.c:1.37 ZendEngine2/zend_unicode.c:1.38
--- ZendEngine2/zend_unicode.c:1.37	Mon Dec 31 07:12:07 2007
+++ ZendEngine2/zend_unicode.c	Fri Mar 21 12:09:28 2008
@@ -47,16 +47,16 @@
 
 		case ZEND_CONV_ERROR_SKIP:
 			if (direction == ZEND_FROM_UNICODE)
-				ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SKIP, UCNV_SKIP_STOP_ON_ILLEGAL, NULL, NULL, &status);
+				ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SKIP, NULL, NULL, NULL, &status);
 			else
-				ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SKIP, UCNV_SKIP_STOP_ON_ILLEGAL, NULL, NULL, &status);
+				ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SKIP, NULL, NULL, NULL, &status);
 			break;
 
 		case ZEND_CONV_ERROR_SUBST:
 			if (direction == ZEND_FROM_UNICODE)
-				ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SUBSTITUTE, UCNV_SUB_STOP_ON_ILLEGAL, NULL, NULL, &status);
+				ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SUBSTITUTE, NULL, NULL, NULL, &status);
 			else
-				ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SUBSTITUTE, UCNV_SUB_STOP_ON_ILLEGAL, NULL, NULL, &status);
+				ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SUBSTITUTE, NULL, NULL, NULL, &status);
 			break;
 
 		case ZEND_CONV_ERROR_ESCAPE_UNICODE:

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug43477.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug43477.phpt
+++ ZendEngine2/tests/bug43477.phpt
--TEST--
Bug #43477 (Unicode error mode)
--FILE--
<?php
var_dump(unicode_decode(b"\xF8", 'UTF-8', U_CONV_ERROR_SKIP));
?>
--EXPECT--
unicode(0) ""
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.