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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: anecdote at yahoo dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Tue Jan 13 03:00:01 2026 UTC