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

var_dump(ini_get('mbstring.internal_encoding'));
var_dump(mb_internal_encoding());
var_dump(ini_get('mbstring.http_input'));
var_dump(ini_get('mbstring.http_output'));

echo "Setting INI\n";
var_dump(ini_set('default_charset', 'UTF-8'));
var_dump(ini_set('internal_encoding', 'UTF-8'));
var_dump(ini_set('input_encoding', 'UTF-8'));
var_dump(ini_set('output_encoding', 'UTF-8'));
var_dump(ini_set('mbstring.internal_encoding', 'UTF-8'));
var_dump(ini_set('mbstring.http_input', 'UTF-8'));
var_dump(ini_set('mbstring.http_output', 'UTF-8'));

echo "Getting INI\n";
var_dump(ini_get('default_charset'));
var_dump(ini_get('internal_encoding'));
var_dump(ini_get('input_encoding'));
var_dump(ini_get('output_encoding'));

var_dump(ini_get('mbstring.internal_encoding'));
var_dump(mb_internal_encoding());
var_dump(ini_get('mbstring.http_input'));
var_dump(ini_get('mbstring.http_output'));
--EXPECT--
Getting INI
string(9) "Shift_JIS"
string(0) ""
string(0) ""
string(0) ""
string(9) "Shift_JIS"
string(4) "SJIS"
string(9) "Shift_JIS"
string(9) "Shift_JIS"
Setting INI
string(9) "Shift_JIS"
string(0) ""
string(0) ""
string(0) ""
string(9) "Shift_JIS"
string(9) "Shift_JIS"
string(9) "Shift_JIS"
Getting INI
string(5) "UTF-8"
string(5) "UTF-8"
string(5) "UTF-8"
string(5) "UTF-8"
string(5) "UTF-8"
string(5) "UTF-8"
string(5) "UTF-8"
string(5) "UTF-8"