php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24607 encoding of .php file affects php behaviour
Submitted: 2003-07-11 11:35 UTC Modified: 2003-07-12 03:55 UTC
From: zjcboy at fescomail dot net Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.1 OS: win xp pro
Private report: No CVE-ID: None
 [2003-07-11 11:35 UTC] zjcboy at fescomail dot net
Description:
------------
PHP Code:
<?php 
session_start(); 
$_SESSION['test']='this is a test'; 
echo $_SESSION['test']; 
?> 
If the code above is encoded in ANSI, it works fine.
But if the code is encoded in Unicode or UTF8, it just says "Cannot send session cache limiter - headers already sent ".

Note that when encoded in different formats, the size of the .php file is different. For example, the code above, when encoded in ANSI, is just 90 bytes. but in Utf8, it is 93 bytes and in Unicode, it's 182 bytes.
PHP Code:
session_start(); 
requires to be put before any output, but in UTF8, the 3 extra bytes compared from in ANSI may cause some output.(I think so)

Because I have to echo some non-english characters (such as Chinese), I have to use Unicode or UTF8 encoding, but it doesn't work as mentioned before. I wonder if there's any way to solve this. 


Expected result:
----------------
no matter how .php files are encoded, they just work fine.


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-12 03:55 UTC] moriyoshi@php.net
Dupe of bug #22247
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 20:01:27 2024 UTC