php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48477 Session always store content in UTF-8
Submitted: 2009-06-05 09:50 UTC Modified: 2009-06-18 15:35 UTC
From: dayseye at 21cn dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.3.0RC3-dev 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: dayseye at 21cn dot com
New email:
PHP Version: OS:

 

 [2009-06-05 09:50 UTC] dayseye at 21cn dot com
Description:
------------
I write some code in charset "GBK" and use session to store some text.
When I get the $_SESSION data, found it's UTF-8, which behave different 
from PHP5.2.x

Reproduce code:
---------------
test.php (ASNI)
================
<?php
session_start();

$_SESSION['name'] = '??????';

echo $_SESSION['name'];

?>

Expected result:
----------------
display:
=========
??????

Actual result:
--------------
display:
=========
text can't viewed  correctly in charset "GBK".

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-05 14:58 UTC] dayseye at 21cn dot com
5.3.0RC2 is OK, RC3-dev cause the problem.
 [2009-06-18 15:35 UTC] johannes@php.net
PHP doesn't care about encodings and passes the strings through, please verify that you're not destroying the encoding somewhere else, send wrong headers, etc.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 30 01:00:02 2025 UTC