php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70035 mbstring.internal_encoding is not derived from internal_encoding
Submitted: 2015-07-09 13:04 UTC Modified: 2016-09-09 06:30 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hoch at fidion dot de Assigned: yohgaki (profile)
Status: Closed Package: mbstring related
PHP Version: 5.6.10 OS: gentoo
Private report: No CVE-ID: None
 [2015-07-09 13:04 UTC] hoch at fidion dot de
Description:
------------
mbstring.internal_encoding defaults to UTF-8 even if internal_encoding is defined differently.

; The precedence is: default_charset < internal_encoding < iconv.internal_encoding

This appears to be incorrect.

Test script:
---------------
php -i | grep encoding

input_encoding => ISO-8859-1 => ISO-8859-1
internal_encoding => ISO-8859-1 => ISO-8859-1
output_encoding => ISO-8859-1 => ISO-8859-1
mbstring.internal_encoding => no value => no value

php -r 'echo mb_internal_encoding();'

UTF-8

After setting mbstring.internal_encoding = "ISO-8859-1"

input_encoding => ISO-8859-1 => ISO-8859-1
internal_encoding => ISO-8859-1 => ISO-8859-1
output_encoding => ISO-8859-1 => ISO-8859-1
mbstring.internal_encoding => ISO-8859-1 => ISO-8859-1

php -r 'echo mb_internal_encoding();'

ISO-8859-1



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-16 06:39 UTC] [email protected]
-Assigned To: +Assigned To: yohgaki
 [2015-07-16 08:26 UTC] [email protected]
Found the cause. NULL (not empty string) setting skips module's ini setting initialization code.
 [2016-09-09 06:30 UTC] [email protected]
-Status: Assigned +Status: Closed
 [2016-09-09 06:30 UTC] [email protected]
This should be fixed. If problem persist, please reopen.
BTW, INI settings are not propagated, but if lower encoding setting is empty, higher precedence setting will be used.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jun 14 01:01:34 2025 UTC