php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40887 ob_start("ob_iconv_handler") can't do nesting!
Submitted: 2007-03-22 04:03 UTC Modified: 2007-03-30 01:00 UTC
From: haha_lover at 163 dot com Assigned:
Status: No Feedback Package: Output Control
PHP Version: 5.2.1 OS: winxp / linux-2.6.11-1.1369_FC4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: haha_lover at 163 dot com
New email:
PHP Version: OS:

 

 [2007-03-22 04:03 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-22 04:16 UTC] 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 10:27 UTC] tony2001@php.net
>PS: bugs.php.net submitting has done htmlentities() to the Chinese
> words in my program.
Upload it somewhere and put the URL here.
 [2007-03-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 17:01:28 2024 UTC