1--TEST--
2iconv_get_encoding() parameter tests
3--CREDITS--
4Oystein Rose <orose@redpill-linpro.com>
5#PHPTestFest2009 Norway 2009-06-09 \o/
6--EXTENSIONS--
7iconv
8--INI--
9error_reporting=E_ALL & ~E_DEPRECATED
10--FILE--
11<?php
12
13iconv_set_encoding("internal_encoding", "UTF-8");
14iconv_set_encoding("output_encoding",   "UTF-8");
15iconv_set_encoding("input_encoding",    "UTF-8");
16
17var_dump( iconv_get_encoding('internal_encoding') );
18var_dump( iconv_get_encoding('output_encoding')   );
19var_dump( iconv_get_encoding('input_encoding')    );
20var_dump( iconv_get_encoding('all')               );
21var_dump( iconv_get_encoding('foo')               );
22var_dump( iconv_get_encoding()                    );
23
24
25
26iconv_set_encoding("internal_encoding", "ISO-8859-1");
27iconv_set_encoding("output_encoding",   "ISO-8859-1");
28iconv_set_encoding("input_encoding",    "ISO-8859-1");
29
30var_dump( iconv_get_encoding('internal_encoding') );
31var_dump( iconv_get_encoding('output_encoding')   );
32var_dump( iconv_get_encoding('input_encoding')    );
33var_dump( iconv_get_encoding('all')               );
34var_dump( iconv_get_encoding('foo')               );
35var_dump( iconv_get_encoding()                    );
36
37?>
38--EXPECT--
39string(5) "UTF-8"
40string(5) "UTF-8"
41string(5) "UTF-8"
42array(3) {
43  ["input_encoding"]=>
44  string(5) "UTF-8"
45  ["output_encoding"]=>
46  string(5) "UTF-8"
47  ["internal_encoding"]=>
48  string(5) "UTF-8"
49}
50bool(false)
51array(3) {
52  ["input_encoding"]=>
53  string(5) "UTF-8"
54  ["output_encoding"]=>
55  string(5) "UTF-8"
56  ["internal_encoding"]=>
57  string(5) "UTF-8"
58}
59string(10) "ISO-8859-1"
60string(10) "ISO-8859-1"
61string(10) "ISO-8859-1"
62array(3) {
63  ["input_encoding"]=>
64  string(10) "ISO-8859-1"
65  ["output_encoding"]=>
66  string(10) "ISO-8859-1"
67  ["internal_encoding"]=>
68  string(10) "ISO-8859-1"
69}
70bool(false)
71array(3) {
72  ["input_encoding"]=>
73  string(10) "ISO-8859-1"
74  ["output_encoding"]=>
75  string(10) "ISO-8859-1"
76  ["internal_encoding"]=>
77  string(10) "ISO-8859-1"
78}
79