# func/006.phpt fails with new output control code

- Thread: https://externals.io/message/23969
- Original archive: https://news-web.php.net/php.internals/23969
- Started by Michael Wallner on 2006-06-06T11:30:02+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #23969 — Michael Wallner — 2006-06-06T11:30:02+00:00

URL: https://externals.io/message/23969#23969

Hi,

Tony noticed that func/006.phpt fails with the new output control code.
The test assumes that the buffer returned by `ob_get_contents()` is unicode
when unicode_semantics=1.

I think the test and previous behaviour are wrong.  Though everything reaching
the output layer should be in output_encoding, we cannot know if the output
handler buffer we are going to return came from another output handler and
what transformations it did to it. Thus, `ob_get_contents()` always returns
a binary string.

See also tests/output/ob_016.phpt

Another undiscussed issue is that output handlers receive binary only
strings, too, of course, but in a controlled environment the developer
should probably always know what she's going to get passed in the 
output handler so she can convert it to unicode if needed.


Opinions, thoughts, flames? :)

Regards,
-- 
Michael
