php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69937 zend.multibyte does not work with UTF-8 PHP files
Submitted: 2015-06-26 09:29 UTC Modified: 2015-06-26 11:27 UTC
From: daniel dot marschall at rinntech dot com Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 5.6.10 OS: Windows 7
Private report: No CVE-ID: None
 [2015-06-26 09:29 UTC] daniel dot marschall at rinntech dot com
Description:
------------
In the PHP.ini I have changed "zend.multibyte = On". Running phpinfo() shows that the value was changed.

But the UTF8 BOM of the PHP file is still sent to the client. Google Chrome has a very buggy behavior when it is receiving a BOM in front of <html> .

(Note: "mbstring.internal_encoding" is set to default)


Test script:
---------------
(This test script is written in ASCII representation - see the BOM!)


<?php

// Just a demonstration to show that the UTF-8 BOM was actually sent
flush();
header('abc:def'); // will fail, because of the previously sent BOM

// Now check that the change in the PHP file did work.
var_dump(ini_get('zend.multibyte')); // string(1) "1"

?>


Expected result:
----------------
Warning: Cannot modify header information - headers already sent ...
string(1) "1"


Actual result:
--------------
string(1) "1"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-26 09:31 UTC] daniel dot marschall at rinntech dot com
(In the report I mixed up actual and expected result.)
 [2015-06-26 11:27 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-06-26 11:27 UTC] cmb@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

zend.multibyte is neither required for UTF-8 encoded source files
nor is it supposed to strip BOMs. Simply save your files without
BOM.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC