php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35038 Header error when saved php file as utf-8
Submitted: 2005-10-31 18:41 UTC Modified: 2005-10-31 19:11 UTC
From: anecdote at yahoo dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5CVS-2005-10-31 (CVS) OS: Win32
Private report: No CVE-ID: None
 [2005-10-31 18:41 UTC] anecdote at yahoo dot com
Description:
------------
I tried the code below with many version of PHP5 include the lastest cvs

1.Open notepad
2.Code below

<?
session_start();
//or header(....);
?>

3.Save as UTF-8
4.test

Result...

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at c:\Inetpub\wwwroot\x.php:1) in c:\Inetpub\wwwroot\x.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at c:\Inetpub\wwwroot\x.php:1) in c:\Inetpub\wwwroot\x.php on line 2

........................

No any character before tag <?
But when open file with Hex editor 

&iuml;&raquo;&iquest;<?
session_start();
?>

There are 3 special characters before tag <?
I think that is a sign to tell editor know it is UTF-8
Why PHP5 error ?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-31 19:11 UTC] derick@php.net
This is called the BOM, and this issue has been reported before. See bug #22108.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 09:01:28 2024 UTC