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