ID:               48697
 Updated by:       moriyo...@php.net
-Summary:          mb_internal_encoding() value gets reset by parse_str()
                   or mb_parse_str()
 Reported By:      glen at delfi dot ee
 Status:           Closed
 Bug Type:         mbstring related
 Operating System: PLD Linux
 PHP Version:      5.2.10
 Assigned To:      moriyoshi
 New Comment:

Changed the summary again as it turned out mb_parse_str() has nothing
to do with this.


Previous Comments:
------------------------------------------------------------------------

[2009-09-14 04:11:48] moriyo...@php.net

This bug has been fixed in SVN.

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.



------------------------------------------------------------------------

[2009-09-14 04:11:29] s...@php.net

Automatic comment from SVN on behalf of moriyoshi
Revision: http://svn.php.net/viewvc/?view=revision&revision=288301
Log: - Looks like bug #48697 has already been fixed in RC1.

------------------------------------------------------------------------

[2009-09-14 00:09:48] moriyo...@php.net

Changed summary

------------------------------------------------------------------------

[2009-07-09 07:21:49] ivan1986 at list dot ru

<?php

echo mb_internal_encoding()."\n";
mb_internal_encoding('utf-8');
echo mb_internal_encoding()."\n";

parse_str('a=1&b=2');

echo mb_internal_encoding()."\n";

?>

ISO-8859-1
UTF-8
ISO-8859-1

must by

ISO-8859-1
UTF-8
UTF-8

------------------------------------------------------------------------

[2009-06-25 18:06:18] glen at delfi dot ee

Description:
------------
setting mbstring internal encoding with mb_internal_encoding() 
function gets reset at some point with 5.2.10, and mb_strtolower() 
etc that are called without implicit charset will fail. (calling 
mb_strtolower() with 2 arguments will succeed.

in other speak, such code fails:
echo mb_internal_encoding(); -> prints ISO-8859-1
mb_internal_encoding('UTF-8');
echo mb_internal_encoding(); -> prints UTF-8
... /// some code ///
echo mb_internal_encoding(); -> prints ISO-8859-1

if i set the internal encoding via php.ini (ini_set() is fine too), 
then the problem does not occour. ie such code works ok:
echo mb_internal_encoding(); -> prints ISO-8859-1
ini_set("mbstring.internal_encoding", 'UTF-8');
echo mb_internal_encoding(); -> prints UTF-8
... /// that same code ///
echo mb_internal_encoding(); -> prints UTF-8


I have not yet able to create exact php code that is exact 
reproducer, but the same php code, input data to php script, it 
works with 5.2.9 and when reverting this commit:
http://www.mail-archive.com/php-cvs%40lists.php.net/msg40593.html

from brief looking i see that there is some inconsistency, that one 
code sets the internal encoding from php.ini and the 
mb_internal_encoding() function does not update php.ini setting.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48697&edit=1

Reply via email to