2010/7/30 Johannes Schlüter <johan...@schlueters.de>:
> Hi,
>
> On Fri, 2010-07-30 at 00:33 +0200, Ferenc Kovacs wrote:
>> > Ignoring the BOF might cause not expected behavior: Assume people are
>> > using PHP as "templating" language and want the BOM to go out to the
>> > client.
>
>> Do you think that this is a common scenario?
>> Apart from a case, when I had to create utf-8 csv files for Microsoft
>> Excel, I never needed to send BOM from php, and for that particular
>> case, I sent it with an explicit echo, not with an "invisible" control
>> sequence in my code.
>
> Well, PHP doesn't change what is written outside <?php ?> (*) so hiding
> "random" bytes (PHP doesn't know what these bytes mean, PHP only knows
> collections of bytes as strings with no further logic) might easily
> break expectations and cause problems which are harder to trace down
> than a "headers already sent" error which is relatively verbose.
>
> johannes
>
> *) Yes there is one behavior which might be seen as an exception: If ?>
> is directly followed by a new line the new line is dropped, but then the
> new line can be seen part of the ?>.
>
> Example:
>
> a<?php
> ?>
> b
>
> Prints
>
> ab
>
> without line break.
>
>

I see your point.

I can not come up anything better than your first idea.

Tyrael

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to