#40887 [Opn->Fbk]: ob_start("ob_iconv_handler") can't do nesting!

From: Date: Thu, 22 Mar 2007 10:27:54 +0000
Subject: #40887 [Opn->Fbk]: ob_start("ob_iconv_handler") can't do nesting!
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110671@lists.php.net to get a copy of this message
ID: 40887 Updated by: tony2001@php.net Reported By: haha_lover at 163 dot com -Status: Open +Status: Feedback Bug Type: Output Control Operating System: winxp / linux-2.6.11-1.1369_FC4 PHP Version: 5.2.1 New Comment: >PS: bugs.php.net submitting has done htmlentities() to the Chinese > words in my program. Upload it somewhere and put the URL here. Previous Comments: ------------------------------------------------------------------------ [2007-03-22 04:16:23] haha_lover at 163 dot com PS: bugs.php.net submitting has done htmlentities() to the Chinese words in my program. If you use this encoded program code , the ob_start("ob_iconv_handler") can work in nestings. But after all, I can't write my templates in this htmlentities style. ------------------------------------------------------------------------ [2007-03-22 04:03:37] haha_lover at 163 dot com Description: ------------ ob_start() can nest as the description in php manual: "Output buffers are stackable, that is, you may call ob_start() while another ob_start() is active." But ob_start("ob_iconv_handler") CAN'T. Reproduce code: --------------- <?php /** * Test: Can I nest ob_start("ob_iconv_handler") ? * * Result&#65306;I can't. It stop at internal nesting when meet a Chinese word. */ iconv_set_encoding("internal_encoding", "GB2312"); iconv_set_encoding("output_encoding", "UTF-8"); ob_start("ob_iconv_handler"); ?> <p> ALTER DATABASE&#29992;&#20110;&#26356;&#25913;&#25968;&#25454;&#24211;&#30340;&#20840;&#23616;&#29305;&#24615;&#12290; </p> <? ob_start("ob_iconv_handler"); ?> <p> ALTER DATABASE&#29992;&#20110;&#26356;&#25913;&#25968;&#25454;&#24211;&#30340;&#20840;&#23616;&#29305;&#24615;&#12290; </p> <? ob_end_flush(); ob_end_flush(); ?> Expected result: ---------------- ALTER DATABASE&#29992;&#20110;&#26356;&#25913;&#25968;&#25454;&#24211;&#30340;&#20840;&#23616;&#29305;&#24615;&#12290; ALTER DATABASE&#29992;&#20110;&#26356;&#25913;&#25968;&#25454;&#24211;&#30340;&#20840;&#23616;&#29305;&#24615;&#12290; Actual result: -------------- ALTER DATABASE&#29992;&#20110;&#26356;&#25913;&#25968;&#25454;&#24211;&#30340;&#20840;&#23616;&#29305;&#24615;&#12290; ALTER DATABASE ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40887&edit=1

« previous php.bugs (#110671) next »