php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45991 parse_ini_file returns empty array if config.ini is saved as UTF-8
Submitted: 2008-09-04 10:13 UTC Modified: 2009-07-22 20:36 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: ckl at ecw dot de Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 5.3.0alpha2 OS: Windows XP SP 3
Private report: No CVE-ID:
 [2008-09-04 10:13 UTC] ckl at ecw dot de
Description:
------------
parse_ini_file returns an empty array while trying to parse any ini-file which is saved as UTF-8.
ISO-8859-1 saved ini-files works as expected.

Reproduce code:
---------------
; Saved as UTF-8
[production]
application.base_url  =
application.data_url  = "data"
database.type         = pdo_mysql
database.host         = 192.168.0.78
database.username     = root
database.password     = 
database.name         = blog

Expected result:
----------------
Get an array..

Actual result:
--------------
array()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-04 14:29 UTC] tularis@php.net
Would that be UTF-8 with the BOM? or without?
 [2008-09-04 14:30 UTC] tularis@php.net
changing to configuration issue
 [2008-09-05 06:49 UTC] ckl at ecw dot de
config.ini was saved as UTF-8 with BOM.
 [2008-09-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-12-23 15:20 UTC] dirk dot thomas at 4wdmedia dot de
I have the same problem with PHP 5.3.0alpha3 under Windows Vista.
The parsed ini-file was saved as UTF-8 with BOM.
parse_ini returns an empty array for me.
 [2008-12-23 15:39 UTC] pajoye@php.net
See #46326 as well (ini broken when BOM are present)
 [2008-12-24 13:50 UTC] scottmac@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 13:02:15 2014 UTC