1--TEST--
2Encoding INI test
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5--INI--
6error_reporting=E_ALL & ~E_DEPRECATED
7default_charset=Shift_JIS
8internal_encoding=
9input_encoding=
10output_encoding=
11mbstring.internal_encoding=Shift_JIS
12mbstring.http_input=Shift_JIS
13mbstring.http_output=Shift_JIS
14--FILE--
15<?php
16echo "Getting INI\n";
17var_dump(ini_get('default_charset'));
18var_dump(ini_get('internal_encoding'));
19var_dump(ini_get('input_encoding'));
20var_dump(ini_get('output_encoding'));
21
22var_dump(ini_get('mbstring.internal_encoding'));
23var_dump(mb_internal_encoding());
24var_dump(ini_get('mbstring.http_input'));
25var_dump(ini_get('mbstring.http_output'));
26
27echo "Setting INI\n";
28var_dump(ini_set('default_charset', 'UTF-8'));
29var_dump(ini_set('internal_encoding', 'UTF-8'));
30var_dump(ini_set('input_encoding', 'UTF-8'));
31var_dump(ini_set('output_encoding', 'UTF-8'));
32var_dump(ini_set('mbstring.internal_encoding', 'UTF-8'));
33var_dump(ini_set('mbstring.http_input', 'UTF-8'));
34var_dump(ini_set('mbstring.http_output', 'UTF-8'));
35
36echo "Getting INI\n";
37var_dump(ini_get('default_charset'));
38var_dump(ini_get('internal_encoding'));
39var_dump(ini_get('input_encoding'));
40var_dump(ini_get('output_encoding'));
41
42var_dump(ini_get('mbstring.internal_encoding'));
43var_dump(mb_internal_encoding());
44var_dump(ini_get('mbstring.http_input'));
45var_dump(ini_get('mbstring.http_output'));
46--EXPECT--
47Getting INI
48string(9) "Shift_JIS"
49string(0) ""
50string(0) ""
51string(0) ""
52string(9) "Shift_JIS"
53string(4) "SJIS"
54string(9) "Shift_JIS"
55string(9) "Shift_JIS"
56Setting INI
57string(9) "Shift_JIS"
58string(0) ""
59string(0) ""
60string(0) ""
61string(9) "Shift_JIS"
62string(9) "Shift_JIS"
63string(9) "Shift_JIS"
64Getting INI
65string(5) "UTF-8"
66string(5) "UTF-8"
67string(5) "UTF-8"
68string(5) "UTF-8"
69string(5) "UTF-8"
70string(5) "UTF-8"
71string(5) "UTF-8"
72string(5) "UTF-8"
73