ID: 38323
Updated by: [EMAIL PROTECTED]
Reported By: zybersup at yahoo dot com
Status: Open
Bug Type: Unknown/Other Function
Operating System: Windows XP Professional
PHP Version: 4.4.3
New Comment:
Please provide access to the exact .ini file that is problematic. I
could not reproduce this on PHP 4 or 5.
Previous Comments:
------------------------------------------------------------------------
[2006-08-04 17:24:34] zybersup at yahoo dot com
Script to reproduce the bug
============================
<?
$dir = dirname(__FILE__) . '/';
$ascii = parse_ini_file($dir . 'test_ascii.ini', true);
$utf8bom = parse_ini_file($dir . 'test_utf8bom.ini', true);
$utf8 = parse_ini_file($dir . 'test_utf8.ini', true);
print_r($ascii);
print_r($utf8bom);
print_r($utf8);
?>
Unsatisfied Result
===================
(Don't worry about the value, just check the difference of array
structure)
Array
(
[Section1] => Array
(
[Aval] => ทดสอบ
ทดสอบ (Test Test)
[Bval] => ไทย
)
[Section2] => Array
(
[Cval] => Bar
[Dval] => Foo
)
)
Array
(
[Aval] =>
เธเธเธชเธญเธ�
เธเธเธชเธญเธ�
(Test Test)
[Bval] =>
เน�เธเธข
[Section2] => Array
(
[Cval] => Bar
[Dval] => Foo
)
)
Array
(
[Section1] => Array
(
[Aval] =>
เธเธเธชเธญเธ�
เธเธเธชเธญเธ�
(Test Test)
[Bval] =>
เน�เธเธข
)
[Section2] => Array
(
[Cval] => Bar
[Dval] => Foo
)
)
Try testing a demo at
http://www.theguru.co.th/zybersup/test_parse_ini.php
(May not keep there more than 2 months)
------------------------------------------------------------------------
[2006-08-04 07:55:08] [EMAIL PROTECTED]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2006-08-04 02:20:24] zybersup at yahoo dot com
Forgot to add more detail that...
I have tested files encoded in ASCII, UTF-8 w/ BOM and UTF-8 w/o BOM on
both PHP4 and PHP5 (5.0.5)
Found no problem with ASCII and UTF-8 w/o BOM. Only UTF-8 w/ BOM has
problem.
Also I found no problem with PHP 5.0.5. So that this problem should not
caused by my INI file, I guess ;).
------------------------------------------------------------------------
[2006-08-04 02:15:57] zybersup at yahoo dot com
Description:
------------
Call the function parse_ini_file() with INI file that written in UTF-8
with BOM.
Set process_sections to TRUE.
The result is an array of all value correctly parsed,
but no section processed.
(That means the result is not multi-dimentional array.)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38323&edit=1