php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46692 include function outputs unwanted 3 byte chars (п�ї)
Submitted: 2008-11-26 20:53 UTC Modified: 2008-11-27 21:56 UTC
From: aleks dot sys at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: * OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aleks dot sys at gmail dot com
New email:
PHP Version: OS:

 

 [2008-11-26 20:53 UTC] aleks dot sys at gmail dot com
Description:
------------
When you use include, require etc functions for including any file even if it contain only <?php?> or <??> or even if it empty it will output some doesn't seen to the eye (in the browser) special chars "&#1087;?&#1111;" 3 bytes (EF BB BF).
It happend when the included file is in UTF-8 encode.

I've found possibly only one solution at least in this stage, is to save the file as "UTF8 without BOM" or ANSI. But don't UTF-8!

After I spent a lot of time to realize it and only when I find the solution to this problem i found another report for this bug: http://bugs.php.net/bug.php?id=22108 from 2003

So it should be or fixed or at least be in the documentation!

Reproduce code:
---------------
---php.php---
<?php
  include('file.php');
?>
---php.php---

--file.php---
 ...empty...
--file.php---

Expected result:
----------------
nothing

Actual result:
--------------
&#1087;?&#1111;

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-27 00:19 UTC] crrodriguez at opensuse dot org
what you see, is the expected behaviuor.
 [2008-11-27 08:14 UTC] aleks dot sys at gmail dot com
Expected? In which manual it is written?
I waste a whole day to understand why my table is one line below the "expected".
 [2008-11-27 15:52 UTC] rquadling@php.net
Your editor is saving your code with the BOM attached.

I have the same issue with EditPadPro.

PHP is not at fault in outputting the BOM.



 [2008-11-27 21:56 UTC] aleks dot sys at gmail dot com
Probably you'r right and PHP really can't avoid this "bug", but my point is that at least it should be well documented in the PHP documentation in the include topic!!
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 04:01:23 2020 UTC