php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19351 Problem with charsets and header function
Submitted: 2002-09-11 03:52 UTC Modified: 2002-09-30 22:07 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:4 (80.0%)
From: sfelix at labeltechnologies dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 4.2.3 OS: win 2k
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sfelix at labeltechnologies dot com
New email:
PHP Version: OS:

 

 [2002-09-11 03:52 UTC] sfelix at labeltechnologies dot com
We have a php installation with the default charset set to "UTF-8" in the php.ini file (default_charset = "UTF-8") because we handle japanese and latin content from the database.
In each page, we specify its charset:

if(the current language is japanese) {
    $strMeta='<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">';
    header("Content-type: text/html; CHARSET=UTF-8",true);
  } else {
    $strMeta='<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=ISO-8859-1">';
    header("Content-type: text/html; CHARSET=ISO-8859-1",true);
  }

With the 4.2.2 version of php we had no problem, but since we updated to 4.2.3, every call to "echo" outputing a text constant like: echo "<html><head><title>"... doesn't work anymore, but echoing data comming from the database works perfectly.

Removing the lines containing the header() function in our scripts resolves this problem, but the page doesn't show properly depending on the language selected in the website.

In php 4.2.2 we don't see this issue happening, so it seems to be a 4.2.3 related problem.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-30 22:07 UTC] yohgaki@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

I think this is fixed in CVS version. If not, please reopen.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 11:01:27 2024 UTC