php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48025 PHP Includes UTF-8 BOM
Submitted: 2009-04-20 11:36 UTC Modified: 2009-04-22 00:57 UTC
From: myh at live dot com Assigned:
Status: Not a bug Package: *Unicode Issues
PHP Version: 6CVS-2009-04-20 (CVS) OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 + 6 = ?
Subscribe to this entry?

 
 [2009-04-20 11:36 UTC] myh at live dot com
Description:
------------
I find PHP includes (require function) the UTF-8 BOM (byte order mark) in my webpages.

That is:
I have three pages, Normal.php, IncParms.php and Parameters.php.
Parameters.php is encoded in UTF-8 with BOM.
(You can download the here:
http://cid-87cef5e6683b5427.skydrive.live.com/self.aspx/Share/PhpBomBug.zip
)

Normal.php shows the normal layout.
But IncParms.php not only includes the PHP code of Parameters.php but also includes the BOM of it.
And the layout shown by IncParms.php is incorrect and different from Normal.php.

You can see the included BOM of the page generated by IncParms.php by a hexadecimal editor.

I recorded a video to exhibit how to reproduce the bug:
http://cid-87cef5e6683b5427.skydrive.live.com/self.aspx/Share/PhpBomBug.avi

Reproduce code:
---------------
http://cid-87cef5e6683b5427.skydrive.live.com/self.aspx/Share/PhpBomBug.zip

Expected result:
----------------
PHP shouldn't include the UTF-8 BOM.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-21 17:01 UTC] jani@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.


 [2009-04-22 00:57 UTC] myh at live dot com
I think my PHP have enabled zend-mulitbyte
because it was configured by --enable-snapshot-build, isn't it?
This is my phpinfo():
http://cid-87cef5e6683b5427.skydrive.live.com/self.aspx/Share/phpinfo.pdf

If my PHP certainly enable zend-multibyte, then the layout error problem remains.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Oct 27 07:01:23 2020 UTC