xref: /PHP-7.4/tests/basic/bug67988.phpt (revision 436ba1c4)
1--TEST--
2Bug #67988 (htmlspecialchars() does not respect default_charset specified by ini_set)
3--INI--
4default_charset=UTF-8
5--FILE--
6<?php
7ini_set('default_charset', 'cp1252');
8
9var_dump(ini_get('default_charset'));
10var_dump(ini_get('internal_encoding'));
11var_dump(ini_get('input_encoding'));
12var_dump(ini_get('output_encoding'));
13
14var_dump(htmlentities("\xA3", ENT_HTML5));
15var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252'));
16
17var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5)));
18var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5, 'cp1252')));
19--EXPECT--
20string(6) "cp1252"
21string(0) ""
22string(0) ""
23string(0) ""
24string(7) "&pound;"
25string(7) "&pound;"
26string(2) "a3"
27string(2) "a3"
28