#46784 [Opn->Csd]: Mixing page encodings (UTF8/ASCII) makes unrecognized session variables

From: Date: Sun, 07 Dec 2008 22:11:41 +0000
Subject: #46784 [Opn->Csd]: Mixing page encodings (UTF8/ASCII) makes unrecognized session variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-131722@lists.php.net to get a copy of this message
ID: 46784 User updated by: simon dot uyttendaele at gmail dot com Reported By: simon dot uyttendaele at gmail dot com -Status: Open +Status: Closed Bug Type: Session related Operating System: Debian etch PHP Version: 5.2.7 New Comment: Recompiling PHP made the problem disapear. It is no longer reproductible. So hopefully, the problem is now solved. Previous Comments: ------------------------------------------------------------------------ [2008-12-06 14:31:09] simon dot uyttendaele at gmail dot com Description: ------------ - Having an auto_prepend script encoded in UTF8 - One regular page encoded in ASCII - A second page encoded in UTF8 (or the other way around) Makes all the associative session variables unrecognized. print_r($_SESSION) does out put the correct session variables. (the key is probably encoded differently which makes it not recognize it) Reproduce code: --------------- PREPEND FILE ENCODED IN UTF8 (no BOM) : <?php $dummy = true; ?> REGULAR FILE ENCODED IN ASCII : <?php session_start(); $_SESSION['foo'] = 42; include( <second page> ); ?> REGULAR FILE ENCODED IN UTF8 : <?php echo $_SESSION['foo']; print_r($_SESSION); ?> Expected result: ---------------- Display : ----------------- 42Array( [foo] => 42 ) ----------------- Actual result: -------------- Display : ----------------- Array( [foo] => 42 ) ----------------- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46784&edit=1

« previous php.bugs (#131722) next »