From: glen at delfi dot ee Operating system: PLD Linux PHP version: 5.2.10 PHP Bug Type: mbstring related Bug description: mb_internal_encoding() value gets reset in process
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 bug report at http://bugs.php.net/?id=48697&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48697&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48697&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48697&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48697&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48697&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48697&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48697&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48697&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48697&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48697&r=support Expected behavior: http://bugs.php.net/fix.php?id=48697&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48697&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48697&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48697&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48697&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48697&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48697&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48697&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48697&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48697&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48697&r=mysqlcfg