Re: PHP5.3.0-dev and Unicode BOM.
| From: | Stefan Walk | Date: | Wed, 05 Mar 2008 12:06:15 +0000 |
| Subject: | Re: PHP5.3.0-dev and Unicode BOM. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35971@lists.php.net to get a copy of this message | ||
On Wednesday 05 March 2008 11:21:14 Richard Quadling wrote:
> But, having just inherited a load of code which are UTF-8 encoded and
> all have a BOM marker, all the BOM markers are being sent to the
> browser. This screws up sessions as output is sent before headers
> (obviously).
>
> The files are english/non english mix, so I'm assuming the BOM needs
> to be present to indicate the order of the encoding (I'm new to the
> Unicode stuff, so this is my first real work with anything other than
> pure english PHP code). Because of this assumption, I think I can't
> remove the BOM marker.
Since the codeunits for UTF-8 are only one Byte long, the BOM is unnecessary.
It's just added from some editors that use it as a marker "This file is
UTF-8". So, you can safely remove it.
Additionally, i don't think PHP has ignored the BOM before.
Regards,
Stefan