xref: /PHP-7.0/tests/basic/encoding.phpt (revision 436ba1c4)
1--TEST--
2PHP encoding setting test
3--INI--
4--FILE--
5<?php
6var_dump(ini_get('default_charset'));
7var_dump(ini_get('input_encoding'));
8var_dump(ini_get('internal_encoding'));
9var_dump(ini_get('output_encoding'));
10
11var_dump(ini_set('default_charset', 'ISO-8859-1'));
12var_dump(ini_get('default_charset'));
13var_dump(ini_get('input_encoding'));
14var_dump(ini_get('internal_encoding'));
15var_dump(ini_get('output_encoding'));
16
17var_dump(ini_set('input_encoding', 'EUC-JP'));
18var_dump(ini_set('internal_encoding', 'EUC-JP'));
19var_dump(ini_set('output_encoding', 'EUC-JP'));
20var_dump(ini_get('input_encoding'));
21var_dump(ini_get('internal_encoding'));
22var_dump(ini_get('output_encoding'));
23
24--EXPECT--
25string(5) "UTF-8"
26string(0) ""
27string(0) ""
28string(0) ""
29string(5) "UTF-8"
30string(10) "ISO-8859-1"
31string(0) ""
32string(0) ""
33string(0) ""
34string(0) ""
35string(0) ""
36string(0) ""
37string(6) "EUC-JP"
38string(6) "EUC-JP"
39string(6) "EUC-JP"
40