|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-06-25 18:06 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 08:00:02 2025 UTC |
<?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