xref: /PHP-8.0/tests/basic/bug67988.phpt (revision 7aacc705)
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?>
20--EXPECT--
21string(6) "cp1252"
22string(0) ""
23string(0) ""
24string(0) ""
25string(7) "&pound;"
26string(7) "&pound;"
27string(2) "a3"
28string(2) "a3"
29