Bug #76679 [Csd->Nab]: mb_http_input does not default to default_charset
| From: | requinix@php.net | Date: | Sun, 29 Jul 2018 23:14:46 +0000 |
| Subject: | Bug #76679 [Csd->Nab]: mb_http_input does not default to default_charset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216521@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76679&edit=1
ID: 76679
Updated by: requinix@php.net
Reported by: ASchmidt at Anamera dot net
Summary: mb_http_input does not default to default_charset
-Status: Closed
+Status: Not a bug
Type: Bug
Package: mbstring related
Operating System: Win x64
PHP Version: 7.2.8
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2018-07-29 22:55:40] 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 22:51:32] ASchmidt at Anamera dot net
Description:
------------
According to documentation on "default-charset" (
http://php.net/manual/en/ini.core.php#ini.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:
---------------
<?php
declare(strict_types=1);
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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76679&edit=1