summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/mb_get_info.phpt
blob: 4b08b9943ff5bfce1c3e620c03a0ccba51ef0898 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--TEST--
Test mb_get_info() function
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip'); ?>
--INI--
mbstring.encoding_translation=1
mbstring.language=Korean
mbstring.internal_encoding=UTF-8
mbstring.http_input=ISO-8859-1
mbstring.http_output=ISO-8859-15
mbstring.http_output_conv_mimetypes=abc
mbstring.detect_order=UTF-8,ISO-8859-15,ISO-8859-1,ASCII
mbstring.substitute_character=123
mbstring.strict_detection=1
--FILE--
<?php
mb_parse_str("abc=def", $dummy);
mb_convert_encoding("\xff\xff", "Shift_JIS", "UCS-2BE");
$result = mb_get_info();
var_dump($result);
foreach (array_keys($result) as $key) {
    var_dump($result[$key], mb_get_info($key));
}
?>
--EXPECT--
array(13) {
  ["internal_encoding"]=>
  string(5) "UTF-8"
  ["http_input"]=>
  string(10) "ISO-8859-1"
  ["http_output"]=>
  string(11) "ISO-8859-15"
  ["http_output_conv_mimetypes"]=>
  string(3) "abc"
  ["mail_charset"]=>
  string(11) "ISO-2022-KR"
  ["mail_header_encoding"]=>
  string(6) "BASE64"
  ["mail_body_encoding"]=>
  string(4) "7bit"
  ["illegal_chars"]=>
  int(1)
  ["encoding_translation"]=>
  string(2) "On"
  ["language"]=>
  string(6) "Korean"
  ["detect_order"]=>
  array(4) {
    [0]=>
    string(5) "UTF-8"
    [1]=>
    string(11) "ISO-8859-15"
    [2]=>
    string(10) "ISO-8859-1"
    [3]=>
    string(5) "ASCII"
  }
  ["substitute_character"]=>
  int(123)
  ["strict_detection"]=>
  string(2) "On"
}
string(5) "UTF-8"
string(5) "UTF-8"
string(10) "ISO-8859-1"
string(10) "ISO-8859-1"
string(11) "ISO-8859-15"
string(11) "ISO-8859-15"
string(3) "abc"
string(3) "abc"
string(11) "ISO-2022-KR"
string(11) "ISO-2022-KR"
string(6) "BASE64"
string(6) "BASE64"
string(4) "7bit"
string(4) "7bit"
int(1)
int(1)
string(2) "On"
string(2) "On"
string(6) "Korean"
string(6) "Korean"
array(4) {
  [0]=>
  string(5) "UTF-8"
  [1]=>
  string(11) "ISO-8859-15"
  [2]=>
  string(10) "ISO-8859-1"
  [3]=>
  string(5) "ASCII"
}
array(4) {
  [0]=>
  string(5) "UTF-8"
  [1]=>
  string(11) "ISO-8859-15"
  [2]=>
  string(10) "ISO-8859-1"
  [3]=>
  string(5) "ASCII"
}
int(123)
int(123)
string(2) "On"
string(2) "On"