|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76679 mb_http_input does not default to default_charset
Submitted: 2018-07-29 22:51 UTC Modified: 2018-07-29 23:14 UTC
From: ASchmidt at Anamera dot net Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 7.2.8 OS: Win x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ASchmidt at Anamera dot net
New email:
PHP Version: OS:


 [2018-07-29 22:51 UTC] ASchmidt at Anamera dot net
According to documentation on "default-charset" (

"The value of default_charset will also be used to set the default character set for ... mbstring functions if the mbstring.http_input mbstring.http_output mbstring.internal_encoding configuration option is unset."

This is true EXCEPT for mbstring.http_input! Querying all other settings will properly return "UTF-8" from the default-charset, but querying mbstring.http_input will return FALSE!

Test script:

var_dump( ini_get( 'default_charset' ) ); // UTF-8 

var_dump( mb_internal_encoding() );      // UTF-8
var_dump( mb_http_output() );            // UTF-8
var_dump( mb_http_input() );             // FALSE
var_dump( mb_regex_encoding() );         // UTF-8

Expected result:
mb_http_input() should return the explicitly set default_charset (e.g., UTF-8).

Actual result:
mb_http_input() returns FALSE, even if default_charset is set to UTF-8.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-29 22:55 UTC] ASchmidt at Anamera dot net
-Status: Open +Status: Closed
 [2018-07-29 22:55 UTC] ASchmidt at Anamera dot net
Sorry - unexpected syntax variation for mb_http_input().
Works correctly with 
var_dump( mb_http_input('I') );             // ['UTF-8']
 [2018-07-29 23:14 UTC]
-Status: Closed +Status: Not a bug
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Sep 26 21:01:24 2023 UTC